[<< wikibooks] Chess/The Endgame/King and Queen vs. King
Delivering checkmate with a king and queen against a lone king is quite easy. The basic technique involves driving the king to the edge of the board, which the queen can do by herself.  It's faster if you use your king and queen together, but this increases the probability of a stalemate, so beginners should do it without the king. The technique described below will accomplish the mate in about 10 to 15 moves.
Here's an example (see diagram on right):
Cutting the black king off along the fifth rank.
1...Kc7 2.Qa6 limits Black's king to the last two ranks.

2.Qc5 (see diagram)
During this phase, notice how White's queen always stays a knight's move away from the black king, and how no checks are necessary (or even desirable).  Moves like 2.Qc6+? only allow Black's king more freedom after 2...Ke5.
2...Kf6 3.Qd5 Kg6 4.Qe5 Kf7
After 4...Kh6 5.Qg3 White's goal has been achieved: the black king is trapped on the edge. White will then bring his king to f6 to force mate.
5.Qd6 Kg7 6.Qe6 Kh7
Black's king is forced to the edge of the board no matter what he does, e.g. 6...Kf8 7.Qd7.

7.Qg4 Kh6 8.Kb2 (see diagram)
Now that Black's king is stuck, the white monarch comes in to finish off his adversary.
8...Kh7 9.Kc3
9.Qg5 doesn't spoil anything, but it isn't necessary. Unlike the king and rook vs. king mate, here Black's king doesn't have to be trapped in the corner.
9...Kh8 10.Kd4
10.Qg6?? stalemate was what Black was hoping for. Beware of this trap!
10...Kh7 11.Ke5 Kh8 12.Kf6 Kh7 13.Qg7#.
A detailed analysis of this endgame based on the computer-generated database is in Analysis of KQK Endgame. This shows that for any "King and Queen vs. King" endgame, white to move can force checkmate in at most ten moves.