Did you know…
What happens if a plane can't land?
Short answer
If a plane can't land at its destination, it diverts to an alternate airport the crew already chose before takeoff and for which it carries extra fuel. In between, it may hold in a pattern for several minutes. If the problem is with the plane itself (the landing gear, for example), the runway is prepared with fire crews and it lands anyway.

The alternate was already decided before takeoff
No commercial flight takes off without a plan for not landing at its destination. The flight plan includes one or two alternate airports, and the mandatory fuel load covers the route, a missed approach, the flight to the alternate, 30 minutes of holding at 450 m above it (the final reserve) and a contingency margin. If the destination closes due to fog, storms, crosswinds or a blocked runway, the crew has three options: wait, divert, or, if conditions improve, try again.
Holding is done in a racetrack pattern assigned by air traffic control, often at several thousand meters of altitude to burn less fuel. It's common at major airports and usually lasts 10 to 30 minutes. If fuel gets close to the minimum needed to reach the alternate with the reserve intact, the captain diverts without waiting any longer.
When the problem is with the aircraft
Another case is when the plane can't land "properly": landing gear that won't extend, a blown tire, a stuck flap. In that case the crew isn't in a hurry: they go through the abnormal procedures checklist, try extending the gear manually by gravity and often request a low pass so the tower can visually check the aircraft's condition. Meanwhile, if the plane is too heavy, they burn fuel in a holding pattern or dump it from the wings if the model allows it, to reach maximum landing weight and reduce the risk of fire.
With the gear partially extended or retracted, the aircraft lands on the fuselage or on whatever gear is available, with fire crews deployed along the runway. These landings are loud and dramatic, but rarely cause injuries: the fuselage withstands the slide and the aircraft stops in a shorter distance than usual. In 2011 a LOT Boeing 767 landed in Warsaw with all three landing gear retracted, and all 231 people on board walked away unharmed.
What never happens
A commercial aircraft never gets "stuck" in the air. There's always a runway within reach, even if it's a military base or a small airfield, and the reserve fuel is meant for exactly that case. If every airport in a region closes at once, as happened in the United States on September 11, 2001, aircraft head to whichever ones remain open, even hundreds of kilometers away. The only landing a pilot will never make is an unsafe one.
More questions

Physics of flight
Why can't a Corsair pilot apply full power when going around after a failed carrier landing?
Because at low speed and high power the Corsair would drop its left wing suddenly and with almost no warning, due to propeller torque. If the throttle was… more…

Physics of flight
What did the phrase "banking with intent to turn" mean among F-104 pilots?
It was a joke among Canadian F-104 pilots: banking the aircraft "with intent to turn" referred to its poor low-speed turning. Its sustained turn capability… more…

Julian Herzog (Website) (CC BY), vía commons Physics of flight
What is "flight envelope protection," which the A320 pioneered?
A set of limits embedded in the flight control software: it calculates the flight envelope, adds a safety margin, and blocks pilot inputs that would take the… more…

Julian Herzog (Website) (CC BY), vía commons Physics of flight
What is the A320's SHARP package for?
SHARP (SHort AiRfield Package) improves takeoff and landing performance on short runways and is designed to increase low-speed lift. It combines aerodynamic… more…

Physics of flight
What flaw sank Vought's all-metal V-141 fighter?
It wasn't a single flaw: tests showed the V-141 still flew poorly, was prone to spinning, and also suffered tail flutter, which is why it was rejected. It… more…

Physics of flight
What wind tunnel did NACA use to study the Corsair, and how big was it?
The full-scale 30- by 60-Foot Tunnel at the Langley Research Center, in Hampton, Virginia. NACA dedicated the facility on 27 May 1931 and used it to test the… more…