Moderators are elected for an indefinite term -- until either they ask to step down or are asked to step down. Any moderator can be demoted at any time at Stack Exchange's discretion.
There is an absentee policy in the works, though it's not in effect yet and may be subject to change:
Any moderator who is not active on the site for a period of six months is subject to removal of their moderator abilities. Moderatorship is an elected position, so if an absentee moderator returns to the site, they may be eligible for reinstatement.
Moderators pro tempore (that is, moderators appointed by Stack Exchange on new beta sites) are replaced when the first election occurs. Unless, of course, they nominate themselves and get elected.
An election is typically run when a moderator resigns or more moderators are needed. Newly elected moderators join the existing ones rather than replace them.
Last but not least, some of the original trilogy moderators were appointed before there was an election process in place. Their appointments are also indefinite, at Stack Exchange's discretion.