The excellent results pushed Alphabet's stock price to a new all-time record in after-hours trading, giving it a valuation of roughly $570 billion and removing Apple from being world's most valuable publicly traded company. As CNBC points out, the last time Google was more valuable than Apple was in February 2010, when both companies were worth less than $200 billion.
Apple and Google actually flip-flopped multiple times between 2008 and early 2010, before Apple went on a historic tear, jumping from $180 billion in value to over $650 billion in September 2012. At that point, the two companies were separated by over $400 billion. In 2011, Apple passed Exxon to become the world's most valuable company.