There are two clocks, one for each player. A clock only ticks down when it's that player's turn.
If a clock reaches zero the game is immediately ended as a loss for that player.
(A rare exception is if your clock reaches zero when your opponent only has a king the game is ended as a draw.)
My last game I was up a few pieces still had my queen and had my opponent in Check. Yet the game ended abruptly with no warning saying opponent wins on time? This has happened to me twice now and both times I was up pieces.
I'm new to chess.com by the way so I don't know how all the rules work. I was playing the 10 minute game