CPUs usually last a long time, and if they do fail, it's usually very early in the lifespan. You're far more likely to have your motherboard fail on you before your CPU unless you tried overclocking and pushed a really high voltage through it, which you can't do on a locked chip anyway.
As for how long it will remain relevant, that will depend on what you use your computer for. There are some people who are still using their first gen i7s from 2008-2009 today and are still reasonably happy with the performance, and might only be looking at upgrades due to chipset features missing on their older platforms or due to their motherboards burning out and it not being worthwhile to try and source a replacement. Barring some unforeseen revolution in computing, your i7 should definitely be relevant for at least 4 or 5 years before you really would feel the need to upgrade for better performance.