A Brahmachari (i.e a student) is to abstain from touching women:
Manu Smriti 2.179.[Let him abstain] From gambling, idle disputes, backbiting, and
lying, from looking at and touching women, and from hurting others
And, for the married men, we have the following relevant verses:
8.356. He who addresses the wife of another man at a Tirtha, outside the village, in a forest, or at the confluence of rivers, suffer (the
punishment for) adulterous acts (samgrahana).
8.357. Offering presents (to a woman), romping (with her), touching her ornaments and dress, sitting with her on a bed, all (these acts)
are considered adulterous acts (samgrahana).
8.358. If one touches a woman in a place (which ought) not (to be touched) or allows (oneself to be touched in such a spot), all (such
acts done) with mutual consent are declared (to be) adulterous
(samgrahana)
I don't think more details are available in the scriptures.