We have an adult cat that we acquired when it needed a new home. She jumps up in the arm of the chair I’m sitting in and pushes her head on my arm. I take this as an invitation to stroke her. Which she seems to enjoy for around 10 seconds, then she bites me! It’s not hard, but not nice, and always makes me jump.
Owners often ask: 'Why does my cat bite me during petting or grooming? ' Cats generally groom one another in short, frequent bursts. People tend to interact less often, but for longer and with more intensity, so a nip is your cat's way of saying 'that's enough'
Try stroking in very short bursts and stop before she feels the need to bite. She may build up to accepting more stroking.
I always call them love bites! One of mine does this and it bloody hurts. I think he gets a bit over sensitised and then bites. He always looks a bit shocked after he's done it as though he wasn't expecting it himself!