The objective in chess is to checkmate your opponents King, and there are three potential ways the game can end:
First, you can checkmate your opponent. This means that the King is in check (under potential attack from an opposing piece) and the player can not make any legal move to remove the King from check. At this point, the game is over and the checkmated player loses. The amount of material on the chessboard is of no concern.
Second, you and your opponent can reach a stalemate - the opponents King is not currently in check, but would be force to move in to check with their next move. Because you can never put your own King in check, you would have no legal moves to make. A stalemate does not mean the attacking player has won. Instead, it is a draw - neither player is victorious.
In timed games, each player has a specific amount of time to make their moves. Once their time runs out, they lose, regardless of the material on the board. That means that you could have only your King legt and deftly avoid mate attempts from an opponent with most of their pieces still on the board and still win the game if your opponent were to run out of time.