Short answer
US and Canadian guidance commonly gives refrigerated hard-boiled eggs up to one week. Chill them promptly and discard eggs left at room temperature overnight.
Why boiling changes storage
Cooking damages the shell’s protective cuticle and can create a thin layer of moisture beneath it. That makes a hard-boiled egg a different storage product from an intact raw shell egg, even though it looks well protected.
Peeled or unpeeled
Both can fit within the one-week refrigerated reference, but peeled eggs dry out and absorb odours more readily. Store them in a clean covered container. Mark the cooking date rather than relying on memory or a spin test.
Room temperature and picnics
US and Canadian advice uses a two-hour limit for cooked eggs at normal room temperature, shortened in high heat. Other countries may use a two-hour/four-hour framework. Overnight is outside either approach.