The temperature of an air parcel (a small blob of air) can be affected by
This section will be dealing with air away from the ground, and will ignore the usually small effects of radiation and diffusion. The temperature changes we will worry about are caused by air ascending, expanding as the outside pressure decreases, and consequently cooling.
The amount of cooling is governed by the laws of thermodynamics, particularly the Ideal Gas Law and the First Law of Thermodynamics. You will learn about the specifics of it in your later coursework. For the time being, suffice it to say that air cools at a known rate, and that an air parcel's temperature at any time can be determined exactly, knowing only its initial temperature, initial pressure, initial humidity (if relevant), and final pressure.
If the air parcel never reaches 100% water vapor saturation, it cools at a very specific rate: 9.8 degrees Celsius per kilometer. You may recognize this to be the same numerical constant as the terrestrial gravitational acceleration, and indeed the two are related. For back-of-the envelope calculations, it is adequate to remember the rate of cooling as approximately 10 C/km. This is known as the dry adiabatic lapse rate.
An example: suppose air at Colorado Springs (1.8 km elevation) is about 35 C (a nice warm day). If this air ascends to the top of Pikes Peak (4.8 km elevation) without exchanging heat with its surroundings, about how cold would it be? Try to answer this question without using pencil, paper, or a calculator.
On really warm summer days, you can actually get a very deep boundary layer, with air well-mixed all the way from the ground to the top of Pikes Peak. When that happens, air really does ascend the whole way without exchanging much heat with its surroundings. The rest of the time, Colorado Springs is not so much warmer than Pikes Peak.