There are several factors involved in the answer.
Some general guidelines can be followed for those looking for some estimates of how long they may need to stay in treatment or recovery programs.

The first step is detoxification, which typically takes about 5-7 days, but it could last anywhere from 2-14 days, depending on the severity of addiction and any other drugs or substances.

After detox, the individual will likely be in an outpatient program to learn how to live life without alcohol and other drugs. This is often a step-down transitional phase that may last for 30 days. Still, it could range from 15 to 120 days depending on how severe their addiction was (typically, 30 days would be a more standard time frame for how long it will take me to get sober).

Inpatient programs are typically the next step in recovery. These programs can be anything from 30 days up to 90 or even 180 days, depending on how severe the addiction was and if any other substances were also used. The length of how long it will take me to get sober depends on how severe the addiction was and how long they need for their mind, body, and spirit to readjust.

Inpatient programs are generally more intensive in treatment than outpatient options, but this is not always true. Some people may feel that a longer period helps them heal from other issues that led them to alcohol or drug.

Getting sober is a process, and the length of time needed depends on how much alcohol you drink, how often you drink, what type of alcohol you drink (wine, beer, or liquor), how your body responds to withdrawal symptoms, and how motivated you are. Suppose someone drinks heavily every day for many years. In that case, they may need a couple of months in rehab followed by many more months of outpatient therapy before they can stop drinking altogether. In contrast, if someone only drank occasionally after work, quitting would be a much quicker process.