From the BBC:
The president is elected for four years and can serve no more than two consecutive terms.
The constitution describes him as the second-highest ranking official in the country. He is head of the executive branch of power and is responsible for ensuring the constitution is implemented.
In practice, however, presidential powers are circumscribed by the clerics and conservatives in Iran's power structure, and by the authority of the Supreme Leader. It is the Supreme Leader, not the president, who controls the armed forces and makes decisions on security, defence and major foreign policy issues.
All presidential candidates are vetted by the Guardian Council, which banned hundreds of hopefuls from standing in the 2005 elections.