Absolutely it totally depends on what you got originally. If you only got an okay ish PC in 2018 then it definitely still won't be fit for purpose in 2025, but if you got a good gaming PC in 2018 it probably will still work in another 5 years, although at that point you'll probably be on minimum settings for most new releases.
I would say 5 to 10 years is probably the lifespan of a gaming PC without an upgrade.
However my crappy work laptop needs replacing after just 3 years because it was rubbish to start with.
And even then, a few strategic upgrades of key components could boost things again. New gfx card, a better SSD, more/faster RAM, any of those will do a lot.
I built an overkill PC in February 2016, it was rocking a GTX 980ti a little before the 1080 came out, and it was probably the best GPU out there, factory overclocked and water cooled by EVGA. My CPU was an i5-4690k, which was solidly mid range then, but I overclocked it myself from 3.5GHz to 5.3Ghz with no issue, and only stopped there because I was so suspicious of how well it was handling that massive increase. I had 2TB of SSD spaceand like 8TB of regular hard drives and 16GB of ram.
Because I have never needed to think about space, and so many of my parts were really overpowered for their generation, I have always been hesitant to upgrade. I don't play the newest games either, I still get max settings on Doom Eternal and Read Dead 2 which I forget are half a decade old. The only game where it's struggled in low settings is Baldurs Gate 3 unfortunately, which is made me realise it's ready to upgrade.