Whoever looks at a woman to lust after her has committed adultery with her in his heart.
I struggled with these issues myself after breaking up with my ex, still struggle at times. A stalker’s attachment to the person they are stalking is always a disordered attachment, a form of unrequited love. If you want them, and they don’t want you back, and you’ve tried in every appropriate and chivalrous way to win their affections, and they still don’t want you, then stop. Otherwise you are not respecting the other person’s free will, and also not respecting your own dignity. Your love deserves to be given to another person who will return the complement, not wasted on someone who doesn’t even like you.
That’s the simple, blunt truth. I still find it hard to take at times, sometimes it would be easier to live in a fantasy world where some relationship still exists with my ex, but that would be a lie, a lie against my dignity and hers, a lie against God’s plan, His vocation for each of the two of us.
You’ve already had some pretty sound advice from others that this is a sin. I just thought I’d try to shed more light on it than simply ‘it’s a sin’ and try to show why. Help your friend to see that this isn’t something that ought to hurt him (because in some ways it’s just as bad for him if he’s mentally stalking her by constantly dwelling on thoughts of her inside his head as if he’s following her around), it’s something that ought to set him free for the grace of true love.