The length of stay at rehab will depend on how severe your addiction is. Detox can take up to 14 days while a brief inpatient programme can last up to 28 days (Dualdiagnosis.org).