Generally speaking, you don't need to worry too much about tips when you're in China. Tipping in restaurants, spas, taxis, salons, etc. is not expected and it can be a welcome respite for those of us from countries where it is a real headache calculating how much one should tip.
That said, it's a little different when you go on organized tours. I can't speak to exactly why tipping is expected on tours, but it's come to be the norm. It is customary on tours to tip the guide and driver a certain amount per day. The guide gets a larger tip than the driver but both will expect and appreciate the tip. Of course, if you feel very strongly against the tip, you don't have to give a tip. However, if you thought the guide/driver were especially bad, then I recommend that you report any bad behavior back to the tour operator so they know and can take appropriate steps.
How do you go figure out how much to tip? I asked tour operator China Odyssey Tours and they gave me the following guidelines:
If you are traveling in a small party like 2 to 4 members, we suggest approximately US $10 per day per person as tips for your tour guide and US $5 per day per person for the driver as gratitude for their service. Gratuities can help improve the service for you. Anyone who has received a tip will recognize that his services have been appreciated. For your convenience, we suggest you tip the guide and driver when they see you off at the airport or pier at the end of each city tour.
Roughly, decide how much you want to tip your guide per day as a total. Then multiply that by however many days you've been on tour (and divide by however many people are in the group. The larger the group, the greater the total daily tip rate should be). When you've arrived at the guide's total, divide by half to get the driver's amount. Note, this doesn't mean you give half to the driver. For example, if you've decided to give your guide 100RMB per day as a tip, the driver will receive 50RMB per day.
As for when to give the tip, often you'll find that your guide will see you right into the lobby or into the airport. If this makes you uncomfortable just say directly that you're fine to go inside on your own. Sometimes guides are obligated by their company to see you walk through security. It's best to tip the driver as you leave the vehicle. Then when you and your guide say your final farewells, hand the guide the tip. If you can let your guide know specifically what you liked about his/her style, it will help them in the future. I have found it truly is the case that they are doing their best and want to please their clients.
I usually put tips inside an envelope from the hotel's stationary (if there is some) with a note of thanks.
My tour was really expensive up front. I don't want to think about tipping on top!
You might have booked a really extravagant tour from your home country and feel that the added gratuity on top is egregious. Before you decide not to tip though, you should speak to the tour operator and ask them what is customary. Don't forget, your guide and driver are probably just simple employees of a larger operation. You may have paid a lot of money for your tour, but your guide and driver are very likely not seeing a big cut of that. They are just doing their jobs.
Tipping Independent Operators
You may find yourself on a small walking tour or guided tour that you booked through an independent operator. There are many people operating specialized shopping and walking tours (e.g. Francine Martin's shopping tours in Shanghai or Marcus Murphy's adventure tours in Qingdao). Since you are paying the tour fee directly to the operator/guide and there aren't any people in between, it is up to you whether to tip or not. I would say from personal experience that a tip in this case isn't necessary.