When I started out on my 7 mile commute, I started by riding there and back on Saturday afternoons. Once I could do that without having to stop, I started riding into work and back 2-3 times a week (usually M-W-F). It took a long time for me to build up to 5 days, about 4-5 months.
About a month in, I had to take a week off because my legs hurt all of the time. I also changed my diet around this time to include a lot more protein (more eggs, more meat, higher protein cereals).
So basic advice:
1. Start off slowly.
2. Remember to listen to your body (if your legs start aching all of the time, take a break!)
3. Eat lots of protein.