A hard drive can last 10 years and sometimes longer.
Most hard disk drives last 3 to 5 years although they can also last longer than that.
Solid state hard drives tend to last 5 to 10 years before they go bad.
Although I still have a 20 year old hard drive that is the old hard disk drive with the spinning platter that is still working in a 20 year old computer.
I use it mainly for viewing photos with and it has worked great so far.
I stil have the data backed up on other drives as well.
If you're using a SSD or solid state hard drive you should plan to replace it within 10 years or sooner.
However as long as you have your data backed up on other drives and even online so that you don't lose the data you can wait until it fails.
I always keep multiple backups of my data around including on multiple flash drives, online file storage, on portable hard drives etc.
Any important data you have should be backed up in multiple locations to prevent data loss.
Hard disk drives that have moving parts may go bad quicker than a solid state drive that has no moving parts.
However even solid state hard drives may go bad sooner than a hard disk drive that has moving parts.
How often you use the hard drive will also impact it's lifespan and if you make a lot of videos, store a lot of data or take a lot of pictures you may need to upgrade to a bigger hard drive before the hard drive actually fails.