There is a distinction between the two sentences.
To say: I ONLY stare at pretty girls indicates that you do not react with them in any other way, for example:
I only stare at pretty girls; I never speak to them.
That's to say that only is modifying stare. All you do is stare; nothing else.
Compare that with:
I stare only at pretty girls; unattractive girls I ignore.
Here only is modifying at pretty girls and not stare. It tells us who you stare at but it doesn't mean that you don't approach the pretty girls and talk to them as well; just that you don't stare at those who are not pretty.
Compare that with the following sentences in which the meaning changes with the placing of only:
I only kissed Mary (all I did was to kiss her)
Only I kissed Mary (I was the only one who kissed her)
I kissed only Mary (I did not kiss anyone else).
(The sentence at the end of your question is perfectly idiomatic. It sounds a little formal, clearly a statement from a teacher to a pupil rather than part of a chatty conversation.)