The simple and obvious answer is that it all depends on the position of black's pawns and king. In general the further up the board the pawns the better for black provided the king is in contact with the pawns, preferably in front of them.
Worth pointing out that the position you give is winning for white because the pawns aren't far enough forward. From what I said earlier it will be clear that white's first task is to separate black from the pawns, then win them.
This is how it is done.
[fen "8/8/8/6kp/p5p/8/K/6Q w - - 0 1"]
1. Qh2 {Cunningly not allowing the king to come forward} h4 2. Qe5+ Kg6 {Step 1 quickly accomplished. Black king separated from the pawns} 3. Qf4 Kh5 4. Qf5+ Kh6 5. Qxg4
and it is game over.
Move the kingside 2 rows forward, however, and best play is a draw, although white can give black opportunities to go wrong. At the same time white has to make sure black can't promote a pawn by checking, pinning or threatening mate.
[fen "8/8/8/8/p7/6kp/K5p/6Q w - - 0 1"]
1. Qe3+ Kh2 {only move} (1...Kh4?? 2. Qf2+ Kg4 3. Ka3 Kg5 4. Qg3+ Kf6 {anything else and Qxh3 will be check} 5. Kxa4 {and the king is going to come over and take the pawns}) 2. Qf4+ Kh1 {another only move} (2...Kg1?? 3. Qg3 Kf1 (3...h2 4. Qe1#) 4. Qxh3 Kf2 5. Qh4+ Kf1 6. Qf4+ Ke1 7. Qg3+ Kf1 8. Qf3+ Kg1 9. Ka3 Kh2 10. Qf4+ Kh1 11. Qh4+ Kg1 12. Kxa4 Kf1 13. Qf4+ {and repeating the process is going to bring the white king over to help and deliver mate}) 3. Qf3 Kh2 4. Qf4+
The two keys to playing these kinds of position are calculation and endgame knowledge. For instance in the second position it is key for black to stop white from winning the h pawn. That is because with just the g pawn black is lost. However replace the g pawn with either an h pawn or an f pawn and the position changes back into a draw.