Contrails: why planes leave white trails
Contrails, short for condensation trails, are the white lines aircraft leave across the sky. NOAA's description is about as plain as it gets: they form when water vapour from an aircraft's exhaust condenses and freezes into ice crystals.

What are contrails made of?
Ice crystals. NOAA's satellite service puts it as contrails form when water vapor from an airplane's exhaust condenses and freezes, forming clouds made of ice crystals. Your breath on a cold morning does the same thing on a smaller scale.
The FAA's account adds the conditions. Contrails are common in the upper levels of the troposphere and in the stratosphere, formed by aircraft flying in clear, cold, humid air when exhaust water vapour saturates or supersaturates the surrounding air. It also notes a second route: they can form aerodynamically, from the pressure drop around wings, nacelles and propeller tips cooling the air to saturation. That's the one you see streaming off a wingtip on a damp day, not trailing behind the engines.
The Met Office puts a height on it. Above 20,000 feet the air around an aircraft is well below freezing, so the water vapour from the engines condenses rapidly and then freezes. Tiny particles from the engine, known as condensation nuclei, give that condensation somewhere to start, which leaves thin trails of ice crystals behind the engines.

Why do some planes leave contrails and others don't?
Humidity, mostly. NOAA's contrail model lets you change the air and watch what happens, and names relative humidity as the variable that affects the rate of dissipation of the contrail, in other words how long it takes to disappear. Two aircraft crossing the same patch of sky minutes apart can behave differently if the air between them has changed.
How long can a contrail last?
Many hours, in humid air. The Met Office explains that in very dry air the ice crystals sublime, changing straight from solid to gas, and the trail becomes invisible. In humid air they stay put and often spread, and the trails can last for many hours, mixing with cirrus cloud. Its high clouds page adds that the streaks can spread out and become cirrus, cirrostratus and cirrocumulus. Contrails tend to show in empty skies under high pressure, when there are very few other clouds around, and they are not large enough to cause any weather on the ground.
Trails belong to the altitudes described in how high planes fly, and a sky full of them is one of the easier things to photograph well, as plane spotting and the rest of the sky get into.
