Petting is the affectionate act of stroking, brushing or caressing an animal's fur, scratching its ears, rubbing its belly, etc., for mutual enjoyment. Grooming behavior in some animals is similar to petting, but generally the verb "pet" refers to a human petting a nonhuman animal or another human being.
By extension, between humans, petting also refers to affectionate stroking and caressing.
However, in a human context, "petting" often refers to amorous or sexual connotations - situations where a person touches the body of another person during kissing or loveplay, especially parts which are typically covered by clothing (e.g., the abdomen or breasts). When the amorous play advances beyond these parameters, and leads to contact with the genitals, through clothing still, it is sometimes referred to as "heavy petting".