A free account opens "Stalemate" and all the following lessons, and keeps your progress.
Stalemate means the side to move is not in check and has no legal move with any piece. In that case the game is a draw, not a win for the other side.
If even one pawn or another piece can make a legal move it is not stalemate. And if the king is in check and there is no legal reply, it is checkmate, not stalemate.
The most important practical point is that in winning endgames you check before every move whether the opponent still has a legal move. For example, when you bring the queen very close to a lone king you may stalemate by accident.
In the lesson's diagram Black is not in check and his only piece, the king on h8, has all three squares around it (g7, g8 and h7) controlled by the white queen or king; so the game is a draw. For the weaker side stalemate is a way to survive.
You practise on the board on the lesson page; some of the exercises:
Exercise 1: Black has only a king. Give mate, but make sure your move (for example Qg6) does not stalemate Black. Answer insight: , mate! Before every non-checking move, check that the opponent still has a legal move; Qg6 would have been stalemate here.
A common mistake is to leave the opponent's king without a move with a queen or rook in a winning position and stalemate. Another is confusing stalemate and mate: in mate the king is in check, in stalemate it is not.
For the concept of check and mate read How the King Moves. For endgame mates where you must watch out for stalemate see Mate with Queen and King, Mate with King and Rook and Ladder Mate with Two Rooks, and for choosing the promotion piece because of stalemate Pawn Promotion.
For stalemate, check every legal move, not just king moves. Even one legal pawn move prevents it. Before capturing the final piece or closing the king's last square, the stronger side should repeat this check to avoid losing the win.
Start by checking whether the king is attacked. Check with no legal reply is mate. Without check, examine every piece and pawn move. A trapped king with a movable pawn is not stalemate. Conversely, a move exposing your own king does not count as legal mobility.
With a large advantage, capturing more material is not always necessary. Picture the opponent's legal moves after a capture. If the resulting position gives check, examine the replies for mate. Without check, at least one legal move must remain for play to continue. This matters especially against a lone king.
For the defender, stalemate may offer a saving resource, but calculate a concrete continuation rather than simply hoping for an oversight. Explain why each apparent move is illegal. That distinguishes a real stalemate from a position that only looks immobile.
With the puzzles on this topic you can also practise the pattern in real positions.
After the exercises of the Stalemate lesson try the same ideas in a real game in Play vs the computer, and to see the rest of the material open the list of lessons.
What is the difference between stalemate and mate? In mate the king is in check and there is no reply and the game ends in a win; in stalemate the king is not in check but there is no legal move and the game is drawn.
How do I avoid stalemating? Before every move in the endgame check that the opponent has at least one legal move.
If the king has no move but one pawn can move, is it stalemate? No; the side to move must have no legal move with any piece and not be in check. A king with no moves while a pawn has a legal move is not stalemate.