Training for a marathon involves a variety of ways to practice. There is no one set way to condition your body for all that is involved in a marathon, people have different ways to train their bodies to be able to cope with the stresses on your body. Running is obviously the most important aspect to condition your body for a marathon, but there is much more involved with being able to create a body that is truly ready for the full deal. Running for 5 hours in one hit requires a body that is both in shape and healthy.
Following healthy eating habits is important to ensure that your body is able to increase its athletic abilities. Make sure you fuel your body with healthy carbohydrates, vitamins, minerals and cut way back on the junk foods. The food you eat will play a big difference on how well your body will be able to function as it is running long distance. Think about how to implement healthy foods into your daily diet and you will eventually be able to run for longer. As you train harder and eat healthier it will become more even apparent how much of a difference it makes.
Have you considered training in other ways for a marathon? Meaning, have you thought about doing other types of cardiovascular exercises such as swimming and cycling? Or what about weight training? Have you thought about conditioning your legs by adding in some weight training? There are many ways you can help strengthen your body so that it is conditioned properly. In order to ensure that your body is ready for a marathon make sure you take time to condition it elsewhere to build your overall endurance and mental fortitude too. Your body can 'plateau' if you only ever challenge it with exactly the same type of exercise.
Training for a marathon is a long and draining process. Hopefully you understand just how great of an accomplishment it is to finish a marathon. To increase your chances of actually finishing a marathon start training as soon as possible. Do your best to dedicate a majority of the weeks leading up to the marathon fully towards training for the event (just don't train every day though). Failing to train properly is the reason most runners don't finish - and when it comes to marathons, finishing really is more important than your overall time. This is not the Olympics, so being first isn't that important, but getting over the line will give you a massive sense of achievement after all your efforts in the lead up.