What is the difference between these two words ?
One thing surprisingly not mentioned so far (and one most important one) is that
парень is way narrower, it's not like boyfriend in modern English - in non-ironical way it's applicable only for younger people. A student can introduce her boyfriend: "Это мой парень", someone in late thirties will sound actually more comical.
Любовник is not a boyfriend either. One will sound unintentionally funny if they introduce their boyfriend/girlfriend as
любовница. The word is used to describe a relationship that is often kept in secret. It also implies that either one or both of the participants are married.
любовница relationships are unofficial in a wide sense of the term "unofficial".
The fact that both terms are not fully equivalent to boyfriend is the reason why in colloquial slang word
бойфренд gains more and more traction.
Парень (a cognate to Lithuanian berniukas) makes an emphasis on the relationship while любовник makes emphasis on love-making:
У неё есть парень / нет парня. А парень-то у тебя, подруга, есть? - the phrases are usually within a scale of socially acceptible / polite talks.
Therefore, it's ok to ask a girl you hardly know or don't know at all;
У тебя есть парень?
And it's not ok to ask her
У тебя есть любовник?