I worked up to a marathon very slowly.   Ran a couple miles a day for a couple years and then I had a 4 1/2 mile route I ran for a year after that.  I did not plan it this way but I had a decent base.    I bought a book that gave suggestions how to train for the marathon itself.  If I remember right it was a 2-3 month regimen.     You would run lets say 4 miles one day and then 6 miles the rest and alternate that way for a couple weeks.   Then increase the longer run a mile or two and continue to alternate where you have a long run and then a short run the next day building up to the 2 weeks before the marathon where you run about 18-20 miles on the long run.