The London Marathon uses a ballot system for general entries, which opens each year in autumn. You can also enter via a charity place, a Good for Age qualifying time, or a Championship entry.
Are there other marathons in London?
Yes — beyond the TCS London Marathon, the capital hosts other marathon events including the Richmond Marathon and various ultra/marathon events in the surrounding areas.