What is the APU actually used for?
Using 747-100/200 aircraft at the two 747 carriers I flew for in the 1990s as an example, the specific uses (not in any particular order) were:


pneumatic power to start the engines
pneumatic power to run the air conditioning packs when the engines were not running.
electrical power on the ground, available regardless of whether the engines were running or not. Many aircraft can use APU electrical power inflight, 747-100/200s do not.
hydraulic power on the ground when the engines were not running via the pneumatic duct. I can't remember whether that could be done inflight.


Assuming that electrial and air was not available from a ground cart, the APU on a cold airplane would be turned on when the airplane was opened up and turned off after the engines were going.

Prior to landing, the APU would usually be turned on a few minutes before landing. It would be left on until a ground cart (if any) was hooked up or until the aircraft was vacated and closed up.

Other aircraft types and operators employ their own procedures, and their APU uses may differ.