Is it possible that I might be asked to temporarily leave a hearing or deposition?

Yes. As you will be observing live cases, there is always the possibility that a proprietary or other confidential matter may arise and a client could prefer for only the parties and the attorneys to be present. If that should occur, you need to follow the instructions of the lawyer you are shadowing.