Moderators are elected to serve until they choose to step down. It's up to them to decide how long to serve. It's completely voluntary and you are encouraged to take breaks and to step down if it ever becomes a burden.
The timeline for the election is as follows:
- Nomination phase today - 7/19 20:00 UTC
- Primary phrase 7/19 20:00 UTC - 7/23 20:00 UTC (not 100% sure on end date)
- Election phase 7/23 20:00 UTC - 7/30 20:00 UTC (again not 100% on start date)
This means that if you were going to be offline for the week of 7/21 you'd miss the end of the primary phase and most of the election. However, this basically only hampers your ability to participate in any candidate chats that might happen, you won't miss the opportunity to respond to comments on your nomination or answer question on meta (as that will be open the entire election period, maybe even the entire primary period as well, not sure on that).