Like this?
What's the right move here?
"Counting" moves will get you the wrong result because you will assume that the most efficient route is the best one. And that is untrue because this endgame is a speed trap.
In your 2nd diagram white dives into the speed trap by racing towards the black pawn. But you made a mistake in the analysis. Black must play 3. ...Kh4! and white has no good move left (zugzwang). Had white taken the slow boat via 1. Ke6 and 2. Kf7 then he would have reached the same position with black to move, leading to a win.
You will never play this endgame correctly until you see the critical zugzwang position coming and find the right way to manage it. This is the critical diagram:

Oh, okay. I should study my endgames more.
Don't feel bad: K+P endgames are tricky. One of my favorite examples of a false assumption leading to tragedy was this case of a master who resigned in a drawn position:
He saw that Kxf3 would lose to ...Kg1, ...h2, ...h1=Q. But he was wrong in assuming that he had to take the f pawn. Instead, Kf2 would draw, as the Black K could never get out of the corner and the f pawn would always be blocked by the White K. btw, the position is taken from van Perlo's Endgame Tactics.
As white how do you calculate the win here? Like how are you counting the number of moves it takes black to take the pawns.