Here we will see Section 354D IPC | Indian Penal Code.
(1) Any man who—
(i) follows a woman and contacts, or attempts to contact such woman to foster personal interaction repeatedly despite a clear indication of disinterest by such woman; or
(ii) monitors the use by a woman of the internet, email or any other form of electronic communication, commits the offence of stalking:
Provided that such conduct shall not amount to stalking if the man who pursued it proves that—
(i) it was pursued for the purpose of preventing or detecting crime and the man accused of stalking had been entrusted with the responsibility of prevention and detection of crime by the State; or
(ii) it was pursued under any law or to comply with any condition or requirement imposed by any person under any law; or
(iii) in the particular circumstances such conduct was reasonable and justified.
(2) Whoever commits the offence of stalking shall be punished on first conviction with imprisonment of either description for a term which may extend to three years, and shall also be liable to fine; and be punished on a second or subsequent conviction, with imprisonment of either description for a term which may extend to five years, and shall also be liable to fine.