You need something like a
tripplite inverter. It has the float charger (this is important), the inverter, and transfer switch all built into 1 unit. Here's the thing you will need in addition to the inverter at least 1 deep cycle battery. DO NOT use a car battery. Car batteries are not built to be drained of power and will only work a few times (maybe 10ish).
How long you can keep stuff running depends on the amp hour rating of the battery. It is important to understand that ac and dc amperage is different (because it relies on voltage. Only 12 from the battery vs 120 from the wall so you need to x or ÷ by 100 for calculations ) and since you are converting dc power to ac devices you lose a lot.
Example.
A 200ah deep cycle battery will run 8.3 dc amps (about 100w) about 10 hrs but the same 200ah battery running 8.3 ac amps (roughly 1000w) would be about 1 hour.
So a single 200ah deep cycle marine battery would run a 500w heater for maybe 2 hours at a continuous run. Heaters cycle off and on so let's say maybe 3 hrs.
Using an inverter is a good idea but for long time use it will only run a powerhead and/or some pumps for any long period of time. Unless you are prepared to have several batteries daisy chained (which can be done).
I'd like to state it's best to have the batteries stored outside in battery boxes rather than in the home. This is because if they overcharge they will vent h2.