Stalemate is a type of draw that occurs when a player whose king is not in check has no available legal moves.
If the game reaches such a situation (when the player's king is not checked, it's his turn to move but he has no available legal moves) the chess rules state that the game is a draw, no matter what advantage one side could have over the other.
Usually, when the game ends in a stalemate, there are a small number of pieces on the chess board.
The reason why there might be no available legal moves is that the pieces could be locked in their positions for a number of different causes:
Just look at the following example. If it's White's turn to move then the position is a stalemate. Both white pawns are blocked; he is unable to move either of his two knights because they are both pinned by the rook from g1 and the knight from d4; he has no safe square on which to move the king. Therefore the game is a stalemate.
Many beginners make the mistake of leading the game in a stalemate, and games they should normally win end up a draw. If you pay attention to your games and study a little bit more, this shouldn't happen to you.
Look at the following example (it's White's turn to move). The solution is obvious: 1. Qd5-b5 Ka4-a3 2. Qb5-b3 checkmate. But, a misguided beginner could move 1. Qd5-c5 which would lead, of course, to a stalemate position. So, always pay attention when playing chess even if you have an advantage over the other side!
There are times of course when a stalemate is inevitable, especially in pawns end games. For example, in an end game of a king and a marginal pawn against a king the player in difficulty takes its king to the square where the enemy pawn should be promoted.
In the next example the game will end in a draw no matter who moves first. White moves 1. a6-a7+ Kb8-a8. And now the draw is obvious. If White moves the king away from the pawn he will lose it and the game will end in draw. If White moves 2. Kb6-a6 the game ends in a stalemate because Black has no available legal moves (both squares b7 and b8 are under the control of the white pieces).
In certain conditions it's sometimes possible for the weak side to execute a number of maneuvers that could lead the game into a stalemate situation. This constitute a tactical procedure you can read about at forcing stalemate.