A deputy period ends at the end date in the definition. However, you can end a deputy period earlier. Go to Operations - Assign Deputy, select the definition from the window list, click or double click on it. Notice the button :
Ending a deputy period in Astrow Web
The deputy will be notified and all the deputy operations rights ceased.