Hard-boiled eggs stay fresh for up to one week in a refrigerator, according to the USDA Food Safety and Inspection Service. Water used for boiling removes the eggs' protective coating, increasing the chance that bacteria enters the shell.
If hard-boiled eggs remain at room temperature for more than two hours, they begin to dry out, which encourages bacteria and mold growth. It is best either to reheat or refrigerate them within two hours of cooking. Store hard-boiled eggs in an egg carton or a container at the back of the refrigerator where it is coldest and not on the side of the refrigerator door where the egg cups are usually located.