My 9 mo old also does this - only with me it's biting my nipples while breastfeeding! OUCH!!! While my daughter may not understand "No", she certainly understands the tone in my voice (per "the experts"), so I firmly tell her "NO!" and remove my nipple from her mouth. She usually cries for 15 seconds or so while I sooth her and explain that that hurts Mommy and she can't do that. She's gotten the message but goes through stages of trial and error from time to time. I keep my responses consistent.
I must admit, though, it's VERY hard not to respond with wanting to inflict pain on someone who's inflicting pain on me! Sad, but true. But, I know that's not the route I want to go and not what I want her to learn so I control that reflex. Sad, though, to learn that that's my natural reflex. It's how I was raised, I'm sure, but I don't want my daughter to have the same experience. (I don't remember being swatted when I was younger, but I'm sure that I was.)
Another habit she has that’s painful to me is digging her nails into or pinching my breast/chest/stomach while she’s nursing. For this, I’ve taken the advice of giving her something else to dig her claws into and pinch – like a lovey or stuffed animal. This is also serving the dual purpose of learning to have a transitional object for naps, etc. She usually still tries to redirect her hand to my skin but I’m persistent in putting the lovey or stuffed animal over my skin and holding it there so she has no other choice but to claw/pinch into that. This one has been easier for me to handle since I know she doesn’t realize she’s hurting me (with the biting the nipple, she’s looking directly at me, (and even smiling sometimes!), and it’s harder to remember she doesn’t realize she’s hurting me - she's obviously looking for my reaction, though - exploring, etc.) It takes persistence but it’s working!
If you do the put her down thing, I wouldn’t suggest leaving the room because she’s also experiencing separation anxiety at this age and that’s just too much. I think putting her down is enough – she doesn’t also need to fear you’re abandoning her, too.
Hope this helps!
Cassie