As the saying goes, "Tipping is not a city in China".
General advice on tipsWhile it is common in the vast majority of western countries to tip your waiters, taxi drivers, masseuses, bellhops and concierges; in mainland China this is not the commonly done thing.
There are exceptions to the no tipping rule, however. Certain industries rely on tips, for example Chinese tour guides, who rely heavily on tips from tourists and commissions from the local restaurants and stops they take their tour groups to in order to survive.
In more luxurious western restaurants and hotels a service charge (generally 10-15%) is usually applied to your bill upon payment; but if you feel that the service was exceptional you can also tip your waiters/maids/bellboys.
However, in the vast majority of situations, tipping is either not necessary, or in some situations prohibited entirely. In fact, if anything it can be considered poor etiquette in China to offer a tip for a service, as it may show that you think they are not sufficiently valued by their employer. Most taxi drivers will refuse tips, though the less scrupulous ones may be happy to take your money.
Tipping close to home
Tipping spreads wealth around and creates incentive in an unequal society. Trusted, quality service is hard to find and should be rewarded if possible. Your bao'an, ayi and other critical personnel are generally paid a pittance for their services, and respond very well to a strip of fancy cigarettes and/or an interest in their family every now and again.
For example, it's common to tip your ayi a thirteenth month's salary at Chinese New Year. Make sure you put this inside a red envelope (红包 - hóngbāo) and deliver it with both hands.
See also gifts.