What type of gas generator to run a dump pump, fridge, and 3 small appliances
1/2 HP Sump Pump - 1000W Run but 2000-4000W startup
Refrigerator - 250W run but 1000-1500W startup
Coffee maker - 500W
Electronics?  You didn't specify.

So as long as your fridge and your sump pump don't startup at the same time, you could get by with a 4000W generator.  A 5000W would give you a bit of margin.

As far as run time, it depends on the fuel capacity of the generator.  You will want to keep extra fuel on hand if the outage lasts longer than the fuel tank capacity of the generator.

To be legal you will either need to run cords to each individual unit or install a lockout transfer switch to avoid the possibility of back-feeding the grid and endangering power company workers.