In the past i5's and i7's have been viable for a good 4-6yrs depending on needs, I wouldn't expect anything different from the current i7's than those from the 4th, 3rd or 2nd gen. Ryzen is due out in the somewhat near future but no real word yet on real world performance or pricing.
There's no ryzen available that's been pitted against existing cpu's across a variety of games or other applications to properly place it's price/performance. It's really no different than intel, it will mean a new cpu, a different motherboard, a reinstall of windows, ddr4 ram. Everything you'd upgrade to run intel you'd be doing for ryzen, at least intel is a known product in terms of price and performance.
Physically cpu's last for years, 7, 8, 10yrs. How long it serves your needs? No telling. Some people upgrade more often than others, there's no set 'rule' that makes sense to a particular group of users. If you like to play cutting edge AAA games you'll probably need a new gpu more often to keep up with the eye candy than someone who's happy running world of warcraft or cs:go.
How long will your cpu remain viable, hard to say. Games in 2 or 3yrs haven't been released yet, they could be really well optimized or they could be the new 'crysis' or 'bf1' and run cpu's into the dirt. You could have a game next year that's more cpu demanding than one released 2-3yrs from now.