For example lets say the power goes out, laptops stay on. Is there any way to accomplish this with a desktop?
Both the above posts are correct, a UPS is the best thing for your needs. They run anywhere between $100-$1,000. Make sure you buy a UPS that is larger than your PSU wattage and your monitor wattage.
What you are looking for is to buy a UPS (Uninterpretable Power Supply).
They are common, but I don't think shops sell many of them, but they should have at least one sort of brand. You just have to shop around.
The longer you want the UPS to last, the more you will have to pay, so if it's a short power outage like for 10 minutes, it will be fine, but for a day, then it's best to turn your computer off to save the power.
It won't guarantee up time in a long power failure, but it will give you enough time to safely shutdown your computer and save your work.
There is, but you're going to need to buy a battery backup. These units look like power strips, but include a battery that can run your computer after the lights go out--typically for an hour or so, enough time for you to save your work and shut everything down. For desktop computers these can get expensive, but it is worth it depending on the type of work you do with your computer. Look into it!