Teach a dog what pressure will stop play when they are using their mouth. It's helpful to teach a dog to release objects in their mouth when training them not to bite with help from a dog trainer in this free video on pet care and obedience training for dogs.
To teach your dog not to bite, is something you might consider working with a professional on, if you have a dog, who's older than a puppy, and is having a problem mouthing, or putting their mouth on your hand, but within the first several months of life, it's a good idea for puppies, to have an opportunity to play, and of course, using their mouth as part of play, and part of their daily life. They're missing thumbs, so they use their mouth in very many situations, we would use our hands, so it's more important to teach your dog what is appropriate pressure, what pressure will stop play. If they were playing with siblings or other dogs, and they bit too hard, the other dog would yelp, and then cease play, and that dog would realize, hey, that's not something I want to do. I want to keep playing. I'm not going to bite as hard next time, so I think it's always a good idea, to do some play, in your dog's mouth. Ideally, you want to have a dog, who resists having their mouth on your hand, like Lady does here. See, this troubles her deeply. She doesn't want to have her teeth on my hand, and that's just a learned behavior, that she bites down, or she mouths, and then I stop playing with her, and she wants to play. It's also a good idea, to have, when you play these kinds of games with your dog, and you play in their mouth. It's a good idea to have your dog well trained, to release anything that you're playing with, so you're playing and things get a little too rough, Lady, come. Come on, get up. Come on, good girl, good girl. Get her a little riled up, she's playing with you, she's mouthing you, and then you can say, Quit, and she just separates from that, and she lets the play stop. That's an important step as well.