You've described two different crimes - forcible rape and statutory rape. The definitions of rape vary from state to state, but here is the definition from my state of Washington.
link states that rape in the first degree is when a person engages in "sexual intercourse" (which as you'll see 由 their
link is any penetration, "however slight") 由 "forcible compulsion" (defined as "physical force which overcomes resistance, 或者 a threat, express 或者 implied, that places a person in fear of death 或者 physical injury to herself 或者 himself 或者 another person, 或者 in fear that she 或者 he 或者 another person will be kidnapped.") In other words -
NO MEANS NO. If the victim is non-compliant, and does not consent, it is
rape. Keep in mind that this definition applies to male victims as well.
The
link are even 更多 specific. They define first degree sexual assault as "a person who subjects another person to sexual penetration, 或者 who forces another person to make a sexual penetration on himself 或者 herself 或者 another, 或者 on a beast, against the will of the victim 或者 under conditions in which the perpetrator knows 或者 should know that the victim is mentally 或者 physically incapable of resisting 或者 understanding the nature of his 或者 her conduct, is guilty of sexual assault."
So like I said, those are the legal definition of rape, but as 你 can see, it all comes down to
consent. If the victim does not consent, then it is rape. If the victim says "stop" 或者 "no" to sex, even if the victim initially seemed willing, sexual activity should
stop immediately.
The scenario 你 described is another crime entirely, called
statutory rape. A person is in commission of this crime if he 或者 she has sex with a person under the age of 18 (or the age of consent in the state/country it's committed). Stat rape is a crime regardless of whether 或者 not the minor consents to it, because the law does not recognize minors as being capable of making informed decisions, and therefore are incapable of consenting. This is also why minors need parents 或者 guardians to consent to other serious decisions including tattoos, piercings, marriage, and surgery.
Even if it's not stat rape, rape between a teacher and a student (maybe an 18-year-old) is still generally against the code of conducts of most schools, on account of the teacher is in a position of power over the student, and having sex with students is seen as an abuse of that power.