If one's father (or mother) enters the room, one must stand for them. Likewise, if one's teacher enters the room, one must stand for him.
The question that arises is, what if the son is the father's teacher? Who stands for whom? Does the son stand for the father, because it is an obligation upon the child to stand for a parent? Or does the father stand for the son because he is his teacher and greater than he is in Torah?
The answer is that each one must rise for the other. However, if the son wishes to forgo his honor, he may. But this only applies in private, or in a place where it is known to all that this is his father.
(See Ben Ish Hai, Shanah Beh, Parashath Shoftim, Oth Yod Aleph)