My German Mother-in-law didn't even keep raw ones in the refrigerator-- though if you, do they can keep for three weeks, maybe more. The thing is, if you buy them you don't really know how long it has been since they were laid.
I have chickens and have learned that hard boiled eggs are almost impossible to peel if you try to boil them when they are really fresh-- before they are a week or two old.
After they are boiled, they keep well for a week, maybe more. If not refrigerated they would be better in a relatively cool place-- a cupboard, maybe.
Another thing-- you don't want to wash them before you store them.
A good way to test fresh ones-- is to see if they sink or float when you put them in water. if they float to the top so part of the shell is out of the water-- they are questionable.
As they age, the pocket of air (gas)gets larger at the bigger end of the egg.