BUT - the very best thing about a mac is if you keep your iMac up to date and only move on to a newer model when it can no longer handle the newest OS version, it can all be moved flawlessly to a new iMac!
That can not be said of a Windows PC - says the IT person who has spent the last several weeks updating PCs to Windows 10. You can not pull a hard drive/SSD out of a Windows PC and more it to a new PC. And not all PCs are able to update to W10! I could write pages on how much fun it has been ....
I have a 2011 iMac going strong. The hard drive was replaced with an SSD which really helped speed her up.
As Nick said, "useful lifespan" is based on the needs of the user. If you want to give your iMac the longest lifespan potential and if you plan to purchase new, get as much memory as possible, the fastest processor, and as large an SSD as you can get - or can afford. This will offer the longest lifespan as technology needs continue to change.
Lisa