The average aircraft will usually suck up a couple thousand feet in order to stop. The average single piston engine aircraft will take less, and a 747 will take much more (>5000ft).
This creates a problem. Aircraft have insane amounts of momentum upon touchdown, and pavement isn't cheap. In addition, we can't have "mobile" airports for military use - so how are we able to deploy combat ready aircraft to anywhere in the world within a matter of hours?
Well, we made mobile airports. And, they float!
The aircraft carrier was first used in 1920. Essentially, it was a floating street where some aircraft landed, and others careened into the ocean, killing their pilots. There was no effective and safe way to stop aircraft on such a small distance.
As of 2013, things have changed. The modern aircraft carrier is a small metropolis, with crews of more than 2,000 sailors. The technology has improved to a point where we're able to launch and recover 90 aircraft on the same ship.
But how do we do it? Simple - Hydraulics!
Laid across the aircraft carrier's deck are four wires. When an aircraft, like the F/A-18 in the video below, hits the deck, the aircraft "catches" one of those wires on a hook attached to the fuselage of the plane. The wire then rapidly sends kinetic energy of the aircraft to "hydraulic dumping systems" that, in simple terms, tug on the aircraft until it's stopped.
It's like a ship with massive, hydraulically-backed rubber bands.
But landing is only half of the story.
How does the F/A-18 launch from the carrier? Sure, it could take off like a conventional airplane, but the runway is far too short! The aircraft would simply fall off the deck. *insert splashing noise here*
We needed some sort of "catapult" to get the aircraft moving fast enough so that the wings could produce more lift than the aircraft's weight.
So, we used what we were experts in - Steam! By pressurizing a tank to very high PSIs, that potential energy is released, dragging the aircraft by yet another hook across the deck with a final velocity of anywhere between 120-150 Knots. These catapults will soon be replaced by electromagnets, that use electric currents to create strong magnetic fields to propel the aircraft into the air. These systems are far less expensive than conventional steam catapults.