In 490 B.C., the fellow who ran 25 miles back home to Athens to announce news of the victory over the Persians at the Battle of Marathon supposedly said, "Rejoice, we conquer!" and then dropped dead.
Modern marathons, originally 26 miles, became 26 miles and 385 yards at the 1908 Games in London. The extra yards were added so the race would finish in front of the royal box.
These days marathon is also used to describe less rigorous events.
For example, as one Twitter user confided to other fans of vampire slaying, "Need to get up and clean, but there's a Buffy marathon on." (ozonemama, April 11, 2010)