The game clock in basketball keeps track of the amount of time in the current half or quarter during a game. The game clock differs between the NBA and NCAA because the NCAA plays two 20 minute halves while the NBA plays four 12 minute quarters. This is presented in the image below. The game clock is the official clock used for all games and referees can stop play in order to change it or make sure it is correct. The game clock is mainly stopped through timeouts by coaches, players, or referees, however, fouls or other stoppages can occur that halt the game clock.
In the NBA, there are four quarters that each last 12 minutes. In an NBA basketball game, the game clock will start with 12 minutes on the clock and tick until it reaches zero. Once the clock reaches zero, the quarter ends. Again, there are plays throughout a game that can also stop the game such as fouls and timeouts.
In college basketball, there are two halves, that each last 20 minutes. Obviously, this differs from the game clock of the NBA, however, the rules surrounding the game clock and stoppages remain the same. Just as in the NBA, the game clock starts and ticks until it reaches zero, once the clock reaches zero, the half ends. However, the game clock starts at 20 minutes and ends at zero in this case.
A buzzer-beater is when a player makes a basket while the game clock hits zero. Usually, the term buzzer-beater is in reference to a game-winning shot but you can also hit a buzzer-beater at the end of a half or quarter. As long as the ball leaves a player's hands prior to the game clock reaching zero, then the basket will still count if it is made. Buzzer beaters are somewhat rare, but when they happen in a game they are exciting for fans and players.
Once the ball is put back into play with a jump ball or throw-in, the game clock starts ticking again. It does not stop unless there is another stoppage of play. The game clock in the stadium is also matched by the game clock on television during the broadcast. This can often lead to technical difficulties between the clock on tv and in the stadium.