There are three kinds of massage relevant to marathon runners:
Deep tissue massage
Treats injuries and tightness. This treatment is ideal at any time during your training up to one week before the competition. The last week before the run is required to give the body time to recover, so the only useful massage in that time is the light pre-competition massage (see below).
The duration of the session depends on the issues to be dealt with. A simple case of scar tissue in the vastus medialis leading to knee pain, for example, can sometimes be successfully resolved in a single 30 minute session, while a case of plantar fasciitis may require a series of 45 minute sessions, for example.
For the first 24-36 hours after a deep massage, you should not subject your muscles to intense training. The tissue needs time to “implement” the benefits of the massage. Going back to full training within that period is likely to cause inflammation. You should also ensure that you drink enough water to help your body flush out waste products.
Pre-competition massage
A general massage which improves circulation throughout the soft tissues and generally loosens up the muscles. It is particularly useful in the last few days before the competition. A 30-minute session is enough for the whole body.
Post-competition massage
Uses the same approach as pre-competition massage. It can greatly support and speed up recovery after the marathon and is ideal in the first day after the race.