You can either maintain power for a few hours with an air-cooled home generator that is powered by either gasoline or propane, or you could buy a much more expensive liquid-cooled generator that will keep your lights on for a while longer.
But if power outages are regular events where you live, you might want to consider installing a set of backup batteries to supply you with electricity when you are off the grid.
These battery storage systems can either consist of dry or wet batteries. Typical dry batteries are lithium-ion batteries used in mobile devices or lithium ferro phosphate batteries commonly used in solar battery backup systems. They do not tend to work well in very hot or cold environments, and some will not work at all if the temperature stays below freezing.
Wet cell batteries use a liquid electrolyte to generate electricity. Lead-acid batteries use lead plates that sit in an electrolyte of sulphuric acid –or acid batteries. Batteries can also contain gel. Gel batteries are a form of lead-acid battery in the class of VRLA (value-regulated lead acid). The acid electrolyte is mixed with a type of silica to produce a gel that will not leak if the battery falls over.
Other batteries have absorbed glass matting (AGM) in place to hold the electrolyte in contact with the plates of the battery. However, AGM batteries can lose power in very cold conditions.
For a seemingly never-ending supply of power, consider a solar panel system to connect to your energy storage system. Your battery backup system will be charged using solar power so that you have a regular supply of solar energy from your solar batteries. 
Solar batteries, also known as solar PV (photovoltaic) systems, will charge your home battery system with renewable energy. If you cannot afford a full set of solar panels, a 13.4kWh (kilowatt-hour) Tesla Power wall, and an uninterruptible power supply (UPS) that is also a surge protector and switches itself on during power outages, how can you run your important items if the power goes out?
If you only want to run a few low-power items, charge your mobile devices or plug in a light, then a portable battery with a solar charger might be more aligned with your budget. I have included some of these lower-cost items at the bottom of this list. 
There are a few important considerations and calculations you need to make before you decide how big your backup system needs to be. You want your home battery storage system to be adequate for your needs. There is more on that at the bottom of this guide.
Also: Battery backup vs standby generators

The market leader in battery backup systems, the Tesla Powerwall, is equipped with all the bells and whistles to make your energy switch to backup battery power as simple as possible. Recharge with solar PV panels, and enjoy the stored solar energy for times when you are off-grid. The Tesla Powerwall + will give you an energy capacity of 13.5kWh and has a power rating of 7.6kW (kilowatt) delivering continuous power of 5.8kW in no sun. The Powerwall + has a ten-year guarantee and can be monitored and managed using its app. You can only buy a Powerwall if you also purchase Tesla’s own solar panels. You can connect up to 10 Powerwalls to ensure you have the right-sized backup batteries for your home. It is recommended to use the Tesla Powerwall with a solar panel system. Some states such as WA (22%) offer a Federal Solar Investment Tax Credit to help with costs. The standard Generac PWRcell system provides 9kWh of storage capacity from three Lithium Ion battery modules rated at 3.0kWh. The system includes an inverter and a battery storage cabinet. Usefully the PWRcell will work with solar panels from most manufacturers so there is no vendor lock-in. Its modular design means that you can expand your storage capacity expanding in increments of 3kWh up to 36kWh. It has a ten-year limited guarantee and can be managed and monitored with an app. The Panasonic EverVolt EVDC-105-4 Standard model is a DC-coupled 11.4kWh battery storage system. It has a modular design with an integrated 5.5kW DC 120/240Vac inverter and PowerHub programmable controller. It will deliver 4.8kW of continuous battery output power at 25A current and has 6 hours average backup capability. It has an app to monitor and control it and comes with a ten-year warranty. The Enphase IQ Battery 10T will give you an energy capacity of 10.5kWh and will deliver 5.76kVA (kilo-volt-ampere) at peak output. It is comprised of three base Encharge 3T storage units. The batteries are made from Lithium Ferrous Phosphate (LFP) and this unit has a power rating of 3.84KW.  It cools passively so there are no moving parts or fans.  It has a ten-year limited warranty and a mobile app to monitor and control the system. Professional installation is a must for this battery storage system. And if retail and installation pricing seems a bit steep, many places offer some sort of payment plan so you can break the final cost into more affordable, monthly payments. You also need to measure the surge current requirements of the items you need to power – especially if you need to start something like a sump pump motor. Don’t expect to be able to power something like a pool filter or air conditioning for days on end. Cost is also a major issue – especially if your requirements total over 15KWh of inverter power or over 30KWh per day for your batteries. You will also need to take into account inefficiencies, voltage drops, and other losses, and calculate to cover all eventualities.