High altitudes normally begin at 1500 metres above sea level. At such altitudes, the atmospheric pressure is considerably lower than at sea level. To give some examples: the pressure at sea level is 14.7 pounds per square inch and it decreases through 4.3 psi at 30,000 ft to 1.6 psi at 50,000 ft. Because of this, the air expands as it rises and this causes it to cool. That is why it is cooler on top of mountains.
As we go up, the air becomes thinner. Air molecules absorb heat from sunlight and collide with each other. As they collide, the heat is dissipated into the atmosphere. So, where the concentration of air is high, like in the plains, the atmosphere becomes hot. At higher altitudes, because of presence of lesser number of air molecules, the number of collision and resultant heat dissipation become less. This is why it’s cooler at higher altitudes.