The five layers of the atmosphere are what protects us from most of outer space, If an alien invasion comes we are screwed, and regulates tempertures. The layers order goes from troposphere, stratosphere, mesosphere, thermosphere, and exosphere in that order.
The troposphere is 0-6 miles above earth and it is the layer we live in, the clouds keep out the heat during the day and keep in the heat at night, weather occurs here, and the air is made of nitrogen and oxygen, but mostly Nitrogen.
The stratosphere is 6-18 Miles or 10-30 Kilometers above earth and it contains the ozone layer, the ozone protects us from the sun's harmful U.V rays, and it is very dry so weather can not occur here.
The mesosphere or the "middle layer " is 18-31 miles or 30-50 kilometers above the earth, Meteors can be seen here, and the air is thinner.
The Thermosphere or the "heated layer" has temperatures ranging from -112º F to 2000º F or more, It is where space shuttles go into orbit, and where we see the aurora borealis. You could really say it's having a heated discussion.
The exosphere or the "outer layer", 248 miles or 400 kilometers from the earth, the exosphere is the outermost layer, and extends into space