If it was specified before by the boyfriend that it is okay with him, then it is not rape. It would only be a rape if the boyfriend says, "Darling, I want to sleep, stop it", and she still keeps doing it.
If it was not, then the girl acts at her own risk. If the boyfriend doesn't want it, then the girl is raping him.
A really simple and obvious example. The fact that the situation is confusing to someone is quite alarming...