It's courteous to inform your colleagues/teachers about your absence as soon as you know you need to take leave. You can send a brief email or message to your immediate supervisor/teacher, explaining the situation and indicating the expected duration of your absence.