Yes, that situation is called a stalemate, which results in a tie. A king is not permitted to move into check, In fact even if in addition to the king there are pawns on the board which are blocked and have no move to make it will be a stalemate, because the only piece able to move would be the king.
Chat with our AI personalities
If the only piece either player controls is a king, then the game is a draw, it's impossible to win.