Students staying hours past end of office hours Background: I am a fourth year math graduate student working as a TA for an introduction to proofs course with a focus on analysis.

I really enjoy the teaching component of my position as a graduate student, but this semester I feel as though students are taking advantage of my generosity.

As is typical for a TA in the math department at my university, I hold a couple (in my case, two) office hours per week, plus additional availability via appointment.  My office hours are nearly always occupied, which generally pleases me.  However, my students nearly always stay well past the point when my office hours are supposed to end, even a couple hours worth in most cases.

In addition, I tend to spend nearly all my waking hours at my office, so I have no problem meeting with students at a wide variety of times.  They are well aware of this, and several of them have requested frequent appointments that do not coincide with my office hours.  Again, the main issue here is that these appointments often last much, much longer than an hour.

I understand that the material of this course is challenging, and I am glad that my students desire to improve their abilities.  However, their behavior is seriously impinging upon my ability to progress in my research.

What are acceptable avenues for reaching a compromise between my need to progress in my work and my desire to assist my students?  So far I've considered the following:


I've attempted to subtly imply that I would appreciate less consumption of my time, but I don't want to discourage their eager approach to their work and they don't seem to be getting the hint.
Alternatively, I could lie about having meetings, other appointments, obligations, etc, but I would feel wrong doing so.
I could obviously just tell them that they can't stay late because I have other work that I need to perform, but again, I don't want to directly shut them down.


Ultimately, I would love to find some systematic way to decrease the strain that they place on my schedule.  One trick I have utilized is the deliberate scheduling of an office hour immediately before the taught class, since both me and any students have to leave at that time to go to class.  Are there other things like this I could do?  

I'm not merely looking for a solution for this semester, because I'd like to prevent this problem in the future as well.
You don't need a "trick" to solve this problem. They're staying past the end of your scheduled office hours because you have been tolerant of this so far. (I suspect they completely missed your subtle hints.)

It sounds like you have made it too easy for them to use you as a crutch, rather than doing the work on their own and then coming to you with specific, focused questions. (Very much like this situation.) It's not good for you and it's not good for them.

At the end of your scheduled office hours, say (with a smile):


  Thanks, everyone, for coming! Don't forget that if you need extra help, you can also schedule an appointment with me.


You can do the same thing at the end of a scheduled appointment:


  It seems like we made some progress here. If you realize you still have questions after working on this some more, you can schedule another appointment.


Then if you need more of a reason to usher them out the door, grab your jacket and announce that you're going out for some coffee/air/exercise/something to eat.

If you think students are using office hours productively and genuinely need more time with a TA, consider letting the course instructor know - perhaps he/she should hire another TA to offer extra support.