There’s no specific age a hard drive should be replaced at. Some hard drives fail only after a few years of use, while others can last over 10 years. Instead, you should keep an eye out for any symptoms that could point towards hard drive failure, such as:
Erratic or severely degraded performance
Unusual clicking or scratching noises from the drive
An increase in bad sectors