Answer:
Yes/depends
Explanation:
A college professor in GENERAL should not try to court their students. It is extremely unprofessional, and could bring unwanted attention to the students.
as for if the students is out of the class, this depends solely on if the student is interested. If they are not interested, or have requested them to stop while they were in their class, they should discontue. If the student IS interested, then they should be able to continue courting them.