If you get a puppy at the standard time, around 9 or 10 weeks, it is YOUR responsibility to teach them this. As you are playing, anytime they bite even a little too hard, make a sharp noise like a yelp or a hissing intake of breath or even just “hey!” not angry, more like in pain, and immediately stop playing. If they try to continue to play turn your shoulder or back to them, ignore them until they stop and let you recover. Then you can go back to playing with them. You are showing them what it looks like when they bite too hard, and what is expected of them in that situation, which is to wait to be invited to play before reengaging. Not only does this train them to not bite too hard, it lets them calibrate to each person, dog, and situation.
Maybe one of your hands is hurt – having grown up learning bite inhibition this way, your dog will pick up that you are wincing or stopping to inspect your hand or making a noise and will adjust their bite force/play style. This is a key aspect of socialization, and will let your dog play well with other dogs, children, etc.
This is also how you teach cats not to bite hard or use their claws with humans. You mime and exaggerate your hurt. The thing you DON’T do is respond with your own aggression, because that just teaches them aggression is okay. You stop play and act hurt.
IME this works with cats of any age. They will eventually learn humans are weak little wimps and need to be treated with kid gloves, i.e. claws retracted.

