The energy consumption depends on the type of air-conditioner. In a single-stage AC, the compressor cools at a steady rate when on, drawing a fixed level of power.
A thermostat switches off the compressor when the desired temperature is reached, and switches it on when the air warms up again. Therefore, the compressor runs for only a fraction of this time - and it is the compressor that consumes most of the power drawn by an AC unit.
In a modern, variable-speed AC, the compressor works nearly continuously but at variable capacity, to match the setting on the thermostat. A higher temperature setting demands lower power consumption, and vice versa.