After faking his death to help bring down big bad Odin Reichenbach, Sherlock disappears for three years and embarks on an unofficial NSA career, even staying out of contact with Joan (although she knows he's still alive). After about a year away, he relapses and uses drugs, but never tells Joan about this, especially after learning that the adoption of her son has gone through.
He's summoned back to Joan's side when a message from Moriarty appears. The threat turns out to be a false alarm, but when Sherlock is about to leave again, he learns that Joan has cancer, so he stays in New York to be her family rather than taking the NSA up on their offer. A year later, she's cancer-free and the duo head to Bell's office to offer their services as NYPD consultants once again.