First, it looks like the very best options for long term support is this guy https://androidenterprisepartners.withgoogle.com/device/#!/F... (Point Mobile PM30) with "Security updates until March 2028". That's 6 years of support, if a little suspicious since it's from a company with a single device on the market.
After that it looks like Samsung offers support for their devices until "February 2027", and one other company, Zebra Technologies, offers support until "March 2027". Going to 2026 adds a few more brands (Motorola, Xiaomi, Google Pixel).
So the bulk of phones have support for 4 years, there's decent options with 5 years of support, a single device with 6 years, and nothing beyond that.
Two data points for contrast:
1. I just bought a 10 year old PC that's still useful, can run the bleeding edge of operating systems, and can be upgraded and repaired easily - I expect it to have another 5 years of useful lifespan ahead of it.
2. The iPhone 6S, released in 2015, is still supported by Apple. That's a 7 year old phone. iOS 13 (released in 2020) dropped support for the iPhone 6/6+ (2014) and 5s (2013) so 6 years and 7 years respectively.
A final note: all of this is about software support - none of this is actually about useful lifespan. Two years ago my phone crapped out on me and I used a friend's old iPhone SE (1st generation, 2016) for a couple months - it was trending hard towards a trash can. The battery lasts about 2 years before it needs replacement, the glass screen breaks easily and aftermarket replacements have touch input issues, and running the latest iOS on it had things moving slower than LA traffic.
My hope is that phones hit / have already hit the end of easy performance advancement, and a focus on longevity might start to take over. But I don't think that's likely. There is pressure from things like large institutional buyers to make generic PCs last long and be endlessly repairable - it's not really clear that pressure exists or CAN exist under capitalism, for phones.