This really depends on how experienced you are with running. If this is going to be your first marathon, you have to commit to training by four months before the run date. You want to get up to that magic number slowly, and conditioning won’t be easy. If this isn’t your first marathon, plan for about twelve to twenty weeks of training. If you have done other marathons before, you could train in two months. If you like to take your time and make sure you’re ready, four months will be sufficient.
Either way, you want to make sure you’re comfortable getting to that magic number. Running three to five times a week will be critical to this kind of training, so getting into a good routine will be key.