My Ceebers used to do that too when he was teething. He also did it b/c he is exploring with his mouth and showing affection. If he did bite too hard/use teeth, I would say, "Ouch Ceebers" really loud and he would back off. When he did I would use a sweet voice and play with a toy that he liked to distract him and teach him what he needs to do get playtime/affection from me.

Hope this helps!

P.S. Rubber toys for him to chew on are good and soothing for his gums too.