From what I know, Google typically provides support for Pixel phones for about 3 years, which is relatively shorter compared to the 5-year support period offered by Apple for iPhones. I wonder if there are better alternatives available.
The actual support for iPhone is actually more like 7 years BUT you should expect no more OS major update after 5 years (only security updates and hardware pieces).