How long it will "last" depends on what someone wants out of it. If you expect to maintain 60fps at ultra settings in the latest AAA games, then it might not last for all that long. It's in a similar performance range as the GTX 1060 6GB, which was launched as a mid-range card nearly two years ago, and there will likely be new cards targeting that segment launched within the next several months or so.
It's also worth noting that the prices of these cards are really messed up right now, mainly due to cryptocurrency miners creating a shortage. When the RX 580 8GB and GTX 1060 6GB launched, they were both approximately $250 cards, while the RX 580 4GB and GTX 1060 3GB were intended to be $200 cards. Miners created a shortage last summer that messed up their prices, especially for the AMD cards, and just as the prices were getting almost back to normal around the new year, another run on cards by miners caused prices to skyrocket once again, this time also affecting higher and lower-end cards across the board.
In my opinion, at the massively inflated prices these cards are currently selling for, they're not really worth it. It seems likely that prices will come down quite a bit later in the year, though how much or when exactly is anyone's guess.