In most modern vehicles, the air conditioning system is powered by the car's engine. The engine drives a compressor, which pressurizes refrigerant gas and sends it through a condenser. The condenser cools the refrigerant, which turns into a liquid. The liquid refrigerant then flows through an expansion valve, which allows it to expand and turn into a gas. This gas is then sent through an evaporator, which absorbs heat from the car's interior and cools the air. The cooled air is then blown into the car's cabin by a fan.
So, while a car does not take gasoline to directly run the air conditioner, the air conditioner is indirectly powered by the gasoline that powers the engine.