Air conditioner (or any cooling machine) has mechanism/ability to pause cooling a room for a while. If this ability doesn't exist, the room will get very cold and could freeze anything in the room.
Is there a word or phrase for this mechanism?
Are you talking about a thermostat?
a device that automatically regulates temperature, or that activates a device when the temperature reaches a certain point.
I'm not aware of one single name for the mechanisms, but things for keeping something constant often use the suffix -stat: thermostat, rheostat, haemostat, barostat, photostat.
The broader process or phenomenon is generally called regulation, though that can mean not only turning things on or off, but also turning them up and down; and it doesn't have to keep effects (e.g. room temperature) in a steady state, it can also gradually change them in a controlled manner. The word stabilize may also be useful to express some aspects of the idea.