An atmosphere is a layer of gases that envelop an astronomical object, held in place by the gravity of the object. The name originates from Ancient Greek ἀτμός (atmós) 'vapour, steam' and σφαῖρα (sphaîra) 'sphere'. An object acquires most of its atmosphere during its primordial epoch, either by accretion of matter or by outgassing of volatiles. The chemical interaction of the atmosphere with the solid surface can change its fundamental composition, as can photochemical interaction with the Sun. A planet retains an atmosphere for longer durations when the gravity is high and the temperature is low. The solar wind works to strip away a planet's outer atmosphere, although this process is slowed by a magnetosphere. The further a body is from the Sun, the lower the rate of atmospheric stripping.
Aside from Mercury, all Solar System planets have substantial atmospheres, as does the dwarf planet Pluto and the moon Titan. The high gravity and low temperature of Jupiter and the other gas giant planets allow them to retain massive atmospheres of mostly hydrogen and helium. Lower mass terrestrial planets orbit closer to the Sun, and so mainly retain higher density atmospheres made of carbon, nitrogen, and oxygen, with trace amounts of inert gas. Atmospheres have been detected around exoplanets such as HD 209458 b and Kepler-7b.