An atmosphere is a layer of gases surrounding a material body of sufficient mass. It is held in place by the gravitational pull of the mass. An atmosphere is more likely to retain if the gravity of the mass is high and the atmospheric temperature is low.
The Earth’s atmosphere contains oxygen which is used by most organisms for respiration. It also protects organisms from genetic damage by solar ultraviolet radiation. Earth’s atmosphere is composed of 78.075 nitrogen, 20.95% oxygen 0.93% argon, 0.038% carbon dioxide and traces of other “noble” gases.
Earth’s atmosphere consists of different layers. From the ground up it contains the troposphere, stratosphere, mesosphere, thermosphere, exosphere and magnetosphere. Each layer has a defining rate of change in temperature with height.
A stellar atmosphere is the outer region of a star. It typically includes the portion starting from the opaque photosphere outwards. Due to the low relative temperature, stars may form compound molecules in their outer atmosphere.
Initially, the atmospheric makeup is related to the chemistry and temperature of the local solar nebula during planetary formation and subsequent escape of interior gases. The original atmosphere started with the radially local rotating gases that collapsed to the spaced rings that form the planets.