Days. Based on the half lives of zoloft (sertraline) (22-36 hrs) and its metabolites (62-104 hrs), it will take most people over a week to clear the drug from their system. Other medications can slow or accelerate metabolism of zoloft (sertraline), so keep that in mind as well.
Zoloft (sertraline) Renal function will also affect the elimination of zoloft (sertraline).
3 weeks. This is complicated. Zoloft (sertraline) has a half-life of about 26 hours, so it takes 4.5 half-lives (5 days) for the level to be less than 5% of its steady state level. But consequences of stopping it, like discontinuation symptoms, may be present even after it has left your blood stream. In my clinical experience, it takes about 3 weeks for those to disappear.