Puppies learn a lot about the world by using their mouth, so nipping is a common way for them to communicate with both other dogs and people. It's your job to teach them that teeth are never allowed on human skin.
Create an Ouch Command
Each time your puppy nips you, you need to respond exactly the same. If you allow him to nip sometimes and not others, the behavior may never go away.
Thus, each time he puts his teeth on you, make a noise that indicates your dog has made a mistake. Most people just yell "ouch," but you can use "no" or another loud, dramatic noise. Most dogs respond very quickly when you say "ouch" as if you have been injured, but this doesn't work with every dog.
Creating a Consequence
Following the "ouch" noise, offer your puppy a toy or something he is allowed to bite. If he choose to continue biting the toy and not you, play with him for a little while and allow him to stay in the room with you. If he bites you again, you must create a consequence.
There are two common consequences that prove to be very effective. For the first, once you have made the "ouch" noise a second time, get up and storm angrily from the room. Don't be subtle about this. Make it very clear that you are unhappy. If there is more than one person in the room, everyone should leave. Go to another room and close the door with your puppy on the other side.
If that seems inconvenient, leave a small leash on your puppy when you are home. After the second "ouch," grab the leash and move swiftly toward your dog's timeout area, which can be a crate or a small room like the bathroom. Don't pick him up. That's too rewarding.
The amount of timeout for either of these timeouts is inconsequential. It can be just a few minutes or longer. If your puppy is barking to get out, wait until he calms down before letting him out.
Avoid Harsh Punishment
Your puppy doesn't mean to hurt you when he bites you, so don't retaliate by hurting him. He's just trying to play with you. You just have to teach him how to do so appropriately.
When puppies bite one another too hard during play, the other puppies will turn their backs on the offender and isolate him. They don't try to bite him back harder. This isn't effective. You should employ this same logic when choosing your consequence.
If you try to punish your puppy by squeezing his nose or another behavior, he may think that you're biting back and that he has chosen an appropriate means of communication. If he's a sensitive puppy, he may become frightened to play with you altogether. To avoid this, choose a consequence that requires less physical punishment.
If you are consistent with your consequence, your puppy will learn very quickly that's it's not OK to put his teeth on humans and will choose more appropriate ways to play with you.