Imparting momentum (actually the aircraft hits the air) in relative sense can be described by molecules hitting the aircraft, but this is more aptly described as mv/s, aka drag.
Heating occurs when energy from impact of individual air molecules going very fast is enough to increase the rate of movement of molecules on the surface of the aircraft. What we know as "heat" is actually a measure of how fast the molecules of a solid are moving, and if sufficient energy is applied, the solid melts or even vaporizes.
Heating occurs at very high altitudes where the True Airspeed is extremely fast, as in multiple Mach. This was referred to in the early days as the "thermal" barrier, beyond the sound barrier.
If a shock wave builds in front of the aircraft, then the collisions will be absorbed by it, with the potential of heating it to an ionized plasma, literally breaking the air molecules into atoms. This phenomena actually lead to a miscalculation of the center of lift during the first Space Shuttle re-entry. The resulting nose-up had to be corrected by dropping a flap on the rear of the delta wing.
To summarize: heating is the result of high energy collisions that input energy faster than it can dissipate.