Its funny I remember going fishing up in the sierras and in the morning it was cold. It didnt makes sense to me why the mountains are cold when I had just learned about heat rising. I was told that the atmosphere was thinner. Still didn't make sense because I thought that would just allow more heat to get through.
Once I started learning exactly what heat was it all clicked. Thin atmosphere has fewer molecule to which radiation can impart energy so the capacity for heating is lowered. Earth itself being solid can absorb much more energy than the air, thus it reemits a lot of energy keeping it hotter near the ground. Until you go above the tropopause that is.

There are a lot of different cool caveats to this but basically the temp drops at about 6.4˚/1000 meters or 3.5˚F for 1000 feet (Lapse rate)
You would think a plane flying 1000 feet over head would be in air that is 3.5˚F cooler than the air at ground level but the rate of change in the gradient is not at all constant near ground level. The first 10 or 20 feet away from the ground could be 10 degrees, depending on the type of surface you are standing on (way more that the average 3.5˚F for 1000)
Interesting stuff.