I used to upgrade my computers after 5-6 years (though I ended up keeping my old 2009 MBP for more than 7), and that's in theory how long I plan to keep the 2018 model I just bought.
The issue is, I don't see the newer MBPs as the well-built tanks they once used to be. They are still excellent machines, but a nightmare to fix, every generation suffers from at least one critical issue, and I had to go through more Apple repairs/replacements in the last 2 years than in the previous 8 combined. Only time will tell, but I've grown a bit pessimistic about their long term reliability.
Back like ten years ago I found Apple’s reliability was really the worst. GPU problems, broken fans, etc.
However I have found my recent Macs don’t seem to have many problems at all, instead I would say they are built better too.