"Where does Earth end and space begin?" Believe it or not, this seemingly simple question does not have an easy answer. As it turns out, pinning down the size of our atmosphere is kind of difficult to do because it grows progressively thinner as the altitude increases—with traces existing more than 500 miles (around 800 km) above the Earth's surface. From that point onward, it begins to gradually merge with charged particles from the Sun that remain trapped in Earth's magnetic field.
Scientists define Earth's current atmosphere as an oxidizing atmosphere. In the past, it was thought of as a reducing atmosphere. It's important to note that, like human-kind, our atmosphere has evolved alongside the changing tides of Earth. Largely, they were the natural result of by the influx of elements and chemicals introduced into the atmosphere by volcanic eruptions, impacts, and (most importantly) carbon and oxygen emissions, the latter became very important during the time known as the Great Oxygenation Event, which took place about 2.7 billion years ago.
The Layers of Earth:
As hinted above, our atmosphere has as many as 5 distinct layers. First there is the troposphere, which contains the bulk of its mass. Near the poles, it starts at the surface and expands more than 30,000 ft (9 km) high—or 56,000 ft (17 km) at the equator.
From there, we have the stratosphere. It begins where the troposphere ends, then 31 miles (50 km) above that. Due to its inherent stability (less turbulence and other forms of weather-related issues), most airplanes cruise here.
Continue moving upward and you will eventually encounter the mesosphere—the section in which meteors generally burn up. Just above that layer is the thermosphere—where aurorae form. After this, we finally come to the exosphere, where the atmosphere ultimately merges with space. It is composed primarily of hydrogen and helium, whilst becoming increasingly thin.
So where does Earth stop and the heavens start? According to a paper that was published in the Journal of Geophysical Research-Space Physics, the border between the two—the so-called Karman line—sits 73.2 miles (188 kilometers) above Earth's surface.
Needless to say, Earth's atmosphere is pretty thick, which is a good thing. It protects us from harmful radiation, space debris, and it helps distribute the energy we receive from the sun.