Usually at most 3 years, I think, and probably more severe for non-opensource or non-free products (including hardware drivers and software storage formats).
Breaking backward compatibility after every major updates is another thing, like what Microsoft Office did. Not sure if online, subscription-based softwares will exacerbate the problems.
The only reason I can be sure of an 8-year-old laptop, is because of Linux.
I also find later that my 3-year-old MacBook Air hardwares cannot be replaced or upgraded -- it is fixed to the mainboard.