When playing any variation of poker, you should always have the right to count your chips. After all, no one else at the table is going to keep track of them, and you certainly don't want to bid more than you can cover. Knowing when to count your chips, however, is a part of poker etiquette. While there's no official rule that says you cannot count your chips during a game, there are also a tableful of players who don't take kindly to delays and deliberate stalling.
In poker games such as the popular Texas Hold'Em, the relative size of each player's chip stacks does have some bearing on the betting process. Those with shorter stacks may have to bid more aggressively than those with higher chip counts, for example. When you count your chips during a game of Texas Hold'Em, it can create a delay in the game's flow and distract your fellow players. By stacking your chips in a more organized fashion, such as in uniform stacks of equal value, then you should be able to count your chips at a glance.
A number of poker players will manipulate their chips during a game out of boredom or stress, but this is not the same as a manual counting of your chips. The bad etiquette arises whenever you count your chips in a deliberately slow manner, especially when it is your turn to place a bet or raise. A quick visual estimate of your holdings should be enough to help you with your betting strategy.
There is another practice which is considered even more offensive than stopping to count your chips. This practice is called "reducing" and is generally discouraged. During a reduction, a player will skim off a certain amount of his or her chips and leave the table briefly. These chips do not return to the table with the player, which means the player is now left with a shorter stack of chips but not a shorter supply of funds. Poker etiquette generally suggests that players not cash out their winnings or remove chips until the game is officially over.
In short, it may not be bad manners to count your chips during lulls in the game, but anything which can slow down the rhythm of the gameplay should be avoided out of fairness to other players.