When I was first asked how to stop a puppy from biting I felt very inadequate, as I didn't really have the answers. Much of what I do with animals seems to be instinctive.
I came to the conclusion that not being bitten by a puppy is a function of how you interact with a puppy. Not being bitten by a puppy can also be considered as teaching the puppy not to bite. But, how is it achieved? It's more about avoiding biting than stopping biting.
Think about when your puppy bites. If rolling around on the ground, playing crazy games with your puppy incites them to bite, don't do it! You can't expect to be able to play wild games with your puppy and for them to not become excited and do what puppies do naturally ..... BITE! So, limit the types of interactions that cause your puppy to bite.
Consider playing structured games with your puppy that don't involve your hand becoming bait. Use a toy instead of your hands. Train your puppy to obey commands by rewarding with treats. Diversion is an effective ploy!
When handling your puppy, encourage calmness. I play the gentle game. This involves saying "gentle" in a quiet, soothing, low pitched voice while I stroke the puppy. Tummy and chest rubs are favourites of my dogs. It's a pleasurable experience they seem to prefer to biting. Hold the puppy so it can't reach your hands. You may need to reposition your hands frequently.
Another huge motivator for biting is motion. You've probably all seen dogs biting at wheels on lawn mowers, wheelie bins, wheel barrows etc. Puppies, however, love to bite at those tempting, moving, trouser ends as you walk along! If it happens, you can pick the puppy up, turn it's mouth away from you & put it down facing away. Carry some treats with you and reward the puppy for walking along beside you. If the puppy is focused on the prospect of frequent treats it won't be so keen on biting.
Be mindful that puppies need a lot more rest than many realise. At eight weeks three quarters of their time should be spent in sleep. Just like people can be "snappy" (metaphorically) when they are tired, so can puppies! During play time, puppies are often more inclined to start biting when they are tired. Always try to let them settle and have a nap before they get to that stage.
Remember that if you excite puppies they will bite. Always try to keep them calm.