If your opponent has no possible legal move to make as you described then it is a draw by stalemate.
It means that as your opponent cannot make a move, you neither won nor lost and nor did your opponent.
It is not enough to leave your opponent with no legal move, you must also have his/her king in check aswell, if it is not in check then it is always a draw
I'm confused! I thought I had won a game and when the message came back it said "game drawn due to stalemate". My opponent had only his king left and on my last move I cornered him with a pawn in front of him and my king at the side. I also had a bishop and a knight but thought my final move with the pawn would be sufficient for a win as it rendered his king unable to move, thus"checkmate?" Am I wrong? If anyone knows why this has happened please do tell.