Jen. biting, like you described, is usually a kitten thing. But I have seen older cats also do it, especially when they are being petted or receiving scritchies. A cat can tell of your displeasure at some antic of theirs, including biting. You can immediately withdraw your hand and whatever you are doing to your pet, or you can use a bottle of spray water if nothing else seems to get their attention. Usually, cats outgrow this tendency to bite when petted, after about 18 months of age.