If your desktop computer is working fine and is able to be updated then there is no need to replace it.
But usually a computer gets outdated and stops receiving updates after 10 years. So 10 years time is a good replacement for a desktop computer.
And it's better to backup your files way before you expect the desktop computer to completely crash and transfer the files to a new computer.
I recommend even if your desktop is still working at 10 years you should plan on replacing it with a new one if you can before it does decide to completely crash and you lose your data on your personal computer.