Puppies bite when they are playing or teething, and for the most part don't hurt. However, puppies need to be trained not to bite, as the puppy will eventually become an adult dog whose bites will be more painful and dangerous. As a general rule, puppies should not be allowed to play-bite hands and feet, as this will give them the impression that biting is OK. Also, begin training your puppy not to bite while they are still 6 to 7 weeks old, as it becomes harder to break the habit as the dog gets older.
When the puppy bites, yelp in pain or cry out so the puppy knows he hurt you and is playing too rough. If he doesn't back off, cry out again and leave him. This will make him think that playmates will leave him when he bites. This is also closer to how other pups will react when they are bitten, and dogs learn to not bite their playmates.
Reward good behaviour. Pour on the praise when the puppy licks instead of bites and always encourage good behaviour.
While you should never hit your puppy when he nips at you, there are some other physical ways to let him know biting is unacceptable. One way is by putting your thumb under his tongue and another finger under his chin and holding that pressure for 10 seconds. Don't hold too tightly. The puppy will associate this unpleasant sensation with biting and be less inclined to bite. You can also use a pinch or choke collar on the puppy and whenever he bites, giving the lead a sharp tug. This has a similar effect to the thumb technique. This should be one of your last resorts.
Noise and Water
Keep a can full of coins or rocks, and rattle the can whenever the puppy bites. The noise will discourage him from biting. You can also spray the puppy with water, as this is another unpleasant sensation it will associate with biting.