How much time computer can last without power?
What you are looking for is called hold-up time. This is the amount of time the power supply can sustain regulation after loss of input power.

Manufacturers provide this data in the power supply specification. Here is an example from Corsair.



source

This is the minimum guaranteed hold-up time from a loss of all input power. In reality you can sustain regulation for longer depending on the specific AC power conditions.