White plays to get his King in front of the pawn.
The position is then a win no matter whose move it is!
There is no win after 1.g6+ Kh8 2.g7+ Kg8 3.Kg6 stalemate.
Notice that in these positions, a pawn check on the 7th rank only wins if the superior side controls the queening square.
White moves his King to take the opposition; 1.Kf7 Kh8 2.Kg6! Kg8 3.Kh6 Kh8 4.g6 Kg8
And now the winning idea, the pawn reaches the 7th rank without check 5.g7 Kf7 6.Kh7 siezing control of the queening square.
6...Ke7 7.g8/Q and White wins.