The atmosphere has a layered structure.
From the earth upward, the layers are:
Four distinct layers have been identified using thermal characteristics (temperature changes), chemical composition, movement, and density.
the troposphere: sea level to 6 km
The troposphere starts at the Earth's surface and extends 8 to 14.5 kilometers high (5 to 9 miles). This part of the atmosphere is the most dense. As you climb higher in this layer, the temperature drops from about 17 to -52 degrees Celsius. Almost all weather is in this region. The tropopause separates the troposphere from the next layer. The tropopause and the troposphere are known as the lower atmosphere.
the stratosphere: 6 to 45 km (contains the ozone layer)
The stratosphere starts just above the troposphere and extends to 50 kilometers (31 miles) high. Compared to the troposphere, this part of the atmosphere is dry and less dense. The temperature in this region increases gradually to -3 degrees Celsius, due to the absorbtion of ultraviolet radiation. The ozone layer, which absorbs and scatters the solar ultraviolet radiation, is in this layer. Ninety-nine percent of "air" is located in the troposphere and stratosphere. The stratopause separates the stratosphere from the next layer.
the mesosphere: 45 to 60 km
The mesosphere starts just above the stratosphere and extends to 85 kilometers (53 miles) high. In this region, the temperatures again fall as low as -93 degrees Celsius as you increase in altitude. The chemicals are in an excited state, as they absorb energy from the Sun. The mesopause separates the mesophere from the thermosphere.

The regions of the stratosphere and the mesosphere, along with the stratopause and mesopause, are called the middle atmosphere by scientists.

the thermosphere:  60 to 600 km 
The thermosphere starts just above the mesosphere and extends to 600 kilometers (372 miles) high. The temperatures go up as you increase in altitude due to the Sun's energy. Temperatures in this region can go as high as 1,727 degrees Celsius. Chemical reactions occur much faster here than on the surface of the Earth. This layer is known as the upper atmosphere
the exosphere: above 600 km, which merges with the thin gases of interplanetary space.
The exosphere starts at the top to the thermosphere and continues until it merges with interplanetary gases, or space. In this region of the atmosphere, Hydrogen and Helium are the prime components and are only present at extremely low densities.
The boundaries between the layers are not sharply defined, and they vary with latitude and season.