Recovery from addiction depends upon a wide range of conditions: the degree and length of the addiction, the detox protocols used, the emotional and psychosocial factors affecting the addict, the quality of treatment, aftercare and support (including treatment of codependency issues in close family members, either therapeutically or by attendance at self-help meetings), and the desire of the addict to become and remain clean and sober.
We could guess that an individual who is successful at staying clean and free of ALL drugs ( including Methadone and Suboxone, after initial detox), would be able to handle most routine activities, jobs, etc. at between 9 months and two years, if they have good supports.
If the person continues with their program of recovery, support groups, and any necessary treatment for psychological problems not directly related to the addiction, they could in many cases be back in mainstream society in two to three years.
Continued recovery is contingent upon cleaning up the chaos in our lives caused by the addiction and any preexisting conditions, maintaining a healthy, relatively stress-free life, and avoiding circumstances that might tempt us to use.