That will depend on the severity of the OCD.
Some residential treatment centers average thirty to sixty days of treatment, with step-downs first to PHP (six hours of treatment each day) and then to IOP (three hours of treatment a day) programs for several more weeks, leading finally into TOP, which can last for a few months to a year or more.
There is no standard recommended time frame for therapy for OCD because each patient has a different presentation.
If a person is on medication for his or her OCD, then in a typical trial he or she will remain on the medication for at least six months, but more typically a year, and then attempt to taper off of the medication. It is important to do this slowly.
If, along the way, the symptoms return, the dosage can be increased, and it may be recommended that a person remain on the medication for several years before again attempting to taper off. And, some people will be on medication for the rest of their lives.