It really depends on the specific components - "mid-high" range is quite vast.
Generally, a mid-high end CPU (i5 or i7 or equivelant) can last you years.... through numerous GPU upgrades (2500K's and 2600K's are still relatively viable 6 years after launch. I wouldn't recommend buying one now, but if you had one, it should still be pretty useful).
If you're strictly asking "if I buy a high end setup now, how long will it last?"..... assuming you're talking a GTX1070/1080/1080TI or RX480/580, it should still be able to play newer titles on low settings as an absolute minimum in ~5 years at 1080p or 1440p.
Looking back 5-6 years, 560TI's to 580 and 6970 to HD6990's were some of the higher end cards. All would still be totally useful in 2017 in the low-medium (and in some games, high) space, but can be lacking in VRAM and use dramatically more power.
Considering the cost of those cards new, the cheaper/better route would've been a mid-range card from the outset, and an upgrade to something like a 970 or 290X (prior gen) when they launched....... or a 1060/1070/RX480 from the latest gen.
The smarter option though, would be to buy an i5 or i7 setup now, with a GPU sufficient for what you want to do today (1080p gaming, for example, a GTX1060 should be sufficient), and upgrade the GPU in a year or two. You'd see more milage out of it.