These days, Google promises at least 7 years, which is longer than most iPhone people seem to use theirs. There's no doubt their limited support windows sucked in the past, but none of that was hidden or a surprise.
Apple could stop updating the iPhone 15 tomorrow and they wouldn't be breaking any promises to anyone. They refuse to publish even a minimum support period.
Pixel devices have historically been really good about letting you unlock the bootloader and install what you want, so even if Google drops support, the community can keep it going.
Apple devices just turn into useless bricks once apple deems them too old. Frankly, I think apple should be legally required to allow users to unlock devices, like you pay for the device, you should be able to use the hardware.
Google’s hardware track record is a joke compared to Apple.
https://www.heise.de/en/news/From-June-20-EU-gives-smartphon...
In other words, manufacturers aren't required to publish updates at all, but if they do provide updates they have to make them available to users for five years after they stop sales. This only stops the case where a manufacturer ships a device and publishes updates for the device, but then takes those updates offline after they stop selling the device (but before 5 years is up).
https://www.theandroidportal.com/motorola-android-update-loo...
I'm having a hard time googling it since every result that comes up is about Google cancelling Nexus phones entirely way back when, but I remember a lot of Nexus users were kind of PO'ed about it.