Hard boiled eggs should not be left out in water overnight because they can grow bacteria overnight which would make them unsafe to eat.
The hard boiled eggs should be kept in a bowl of water and placed in the refrigerator which will make them last for up to a week.
You could can the hard boiled eggs and then they would last 6 months or longer but if you're just refrigerating the hard boiled eggs they should be consumed within a week of boiling them.
The same goes for eggs in the shells that are uncooked.
If the eggs you bought were previously refrigerated such as in the store you should always keep those eggs in the refrigerator to prevent them from going bad.
If you leave eggs out on the counter they can go bad and you'll notice a bad smell to them when you crack the eggshell.
The bad eggs could make you sick.