When you go to inpatient treatment, you're committing to a 30-day program, most of the time. There are some rehabs that offer longer lengths of stay. Some may offer 90-day rehab programs. Again, this will all be explained to you.
Usually, your stay will involve going through the detox process first. After that, you'll transition into rehab, which will include different types of therapy. While you're there, you'll work on healing from the issues that led to your addiction.
It may be hard for you to imaging taking so much time and dedicating it to your recovery. However, those who have done it before you are so glad that they did. Inpatient rehab is truly a life changing experience, and it has helped so many addicts and alcoholics.