The answer to this question may surprise you: while uncooked eggs typically last four to five weeks when properly refrigerated, hard-boiled eggs will only last about a week. This is because egg shells, which are highly porous, are sprayed before sale with a thin coating of mineral oil that seals the egg. Boiling the egg washes this coating away, however, leaving the shell susceptible to bacteria.
Source: FS – All – Food and Nutrition Blogs
How Long Do Raw and Hard-Boiled Eggs Keep?