Menstrual cups

I don't use them but I'm just curious. From what I gather you put it in and then have to empty it. Not complicated. But how long can you keep it in? And what do you do if you're at school and have to empty it? For example, I leave for school at 6am and don't get home till around 9pm. How would I clean it there?