The Centers for Disease Control and Prevention offers these food safety guidelines.
If the power is out for less than 2 hours, then the food in your refrigerator and freezer will be safe to consume. While the power is out, keep the refrigerator and freezer doors closed as much as possible to keep food cold for longer.
If the power is out for longer than 2 hours, follow the guidelines below:
For the freezer section: A freezer that is half full will hold food safely for up to 24 hours. A full freezer will hold food safely for 48 hours. Do not open the freezer door if you can avoid it.
For the refrigerated section: Pack milk, other dairy products, meat, fish, eggs, gravy, and spoilable leftovers into a cooler surrounded by ice. Inexpensive Styrofoam coolers are fine for this purpose.
Use a food thermometer to check the temperature of your food right before you cook or eat it. Throw away any food that has a temperature of more than 40 degrees Fahrenheit.