Google’s Pixel and Pixel XL phones won’t have the end for their Android and security updates for a while, thankfully. In order to clarify, Google has posted when those updates will stop on its end-of-life support page. Normally Google updates its devices for two years, security updates for three years or 18 months after the Google Store runs out of stock.
It shows that Android OS updates for both phones are not guaranteed after October 2018. That means the Pixel and Pixel XL should not only get Android O, which is scheduled for release in the fall of 2017, but also the version of Android after that (Android P?) as well. Security updates for the phones are not guaranteed after October 2019, which means that both phones should be safe to use for over two years.
Google also has confirmed on the same page that Android updates for its older Nexus 5x and Nexus 6P phones are not guaranteed beyond September 2017, and security updates for those devices may not be released after September 2018. The Nexus 6 phone and Nexus 9 tablet, both of which have already reached the end of their Android updates, won’t get any more security updates after October 2017.