Scoring in backgammon depends on the type of game you are playing. In general, points are awarded only at the compeletion of a game. How many points you are awarded depends on the state of the board at the time of completion. Games are won by a player bearing off (removing) all of their tokens from the board.
The Basics
A won game is a Single if the opposing player has managed to bear off at least one token. The winner gets either 1 point or the amount determined by the doubling die.
A won game is a Gammon if the opposing player has not managed to bear off a single token. The winner gets either 2 points or double the amount determined by the doubling die.
A won game is a Backgammon if the opposing player has not managed to get all of their checkers out of the winner's home board. The winner is awarded either 3 points or triple the amount determined by the doubling die.
Playing with the Doubling Die
The principle role of the doubling cube is to increase the stakes of a game. A player is allowed to double the stakes of a game only at the beginning of their turn. Doubling is not allowed on the first roll, or move, of the game and is disallowed in a matched game where the leader is within one point of winning the match. (See the matches help topic for more details)