Distribution of lengths of power outages
Ask your local regulatory agency. They will probably have that information.

However, the usual practice for anything but critical servers is to decide how long you will need to finish what you were working on, save it, and shut down cleanly.

If you really want to run for many hours, the simplest answer is just to use a laptop machine. They are designed for power efficiency and to run for hours off their internal batteries, and effectively have their own UPS built in.