Kittens will bite. That is how they play. To get them to stop, all you have to do is "get bigger" when ever it happens. Spreading your fingers out and growling should be enough. If not then, stand up and growl. After a few weeks the kitten will stop.
For adult cats, biting while playing is not uncommon. If the bite is not drawing blood or not intending to draw blood, then the cat is just trying to play as if it were still a kitten. If that is the case, then the same solution is used - get bigger and growl. Most cats will learn they have cross the line start adapting.
If the cat is biting while you are petting it and it is purring up a storm, then the bites are probably little nips. Those hurt! I won't go into the kitty psychology behind them, but you
Neutering your male is also recommended if it has not already been done.
When kittens are growing & playing with their siblings this is natural. I watched a show with a cat expert. He explained that we can simply & firmly say no, but not punish. Especially when we misunderstand that we only encourage their natural tendencies when we play with our kittens & cats using our hands & playing rough. This is how we teach them to scratch & bite because it is natural to them. Use toys to play with them, not your hands. The humans bear the responsibility. Why would you play aggressively with your cat & then flick him in the nose when you are setting the terms of playing? Shame on anyone that thinks this is okay.
I have had numerous cats during my life and I find the less offensive way of doing things such as the squirt bottle but for it to work you have to train them with it from a kitten or else it really does no good flicking them on nose is more something done on dogs than cats it is recommended to use A squirt bottle or something that will likely not provoke the cat into possibly doing more than just biting but as it has been said you need to determine the type of biting being done whether playful or defensive.