If you want to enter Iran, receiving visa will be essential. Procedure of getting visa from your home country is as follow:
1. Contact with an Iranian Travel Agency.
2. Your personal data will be sent to Iran Ministry of Foreign Affairs (IMFA) by the travel agency.
3. Your visa will then be authorized by the IMFA and IMFA will fax it to the Iranian Consulate near you.
4. Your travel agent gives you a visa authorization number with which you can refer to the consulate to get your visa. The visa authorization number, however, is valid only in the consulate you have asked them your visa to be issued in. The number they give you is just an “authorization”. This reference number means that your visa has been authorized and approved by the Ministry of Foreign Affairs but is not the visa itself.
5. Depending on your nationality, you may be required to present at the Iranian consulate in your country to have your fingerprints. British, Canadian, and American passport holders will have biometric check upon their arrival.
6. After your travel agent tells you your visa authorization number you should first get a visa application form from the consulate and follow the requirements of the application form (you may either personally go to the consulate to get the application forms or, if the service available, download it from the website of the Iranian embassy in your country).
7. Then, you should refer to the consulate to lodge your passports and application forms with the visa number they gave you (it can be either a physical presence or by post). Then it might take from 1-5 days for the consulate to issue your visa.
8. You may also need to provide a letter of recommendation from your embassy if you are applying outside your home country, a copy of your flight ticket to and from Iran and any student or press card.
Normally, all tourist visas issued by Iranian consulates have a 3-month validity. The visa allows you to stay in Iran for up to 30 days, although the duration of your visa is at the discretion of the Iranian Foreign Ministry.
Rarely, you may be asked to provide a letter from your employer or proof of fund. Visas are generally valid for three months which means you must enter Iran within three months of issue.

How can you get visa on your arrival to Iran?
A valid passport and a visa are required for the citizens of most countries who aim to travel to Iran. Citizens of all countries except Afghanistan, Bangladesh, Canada, Colombia, India, Iraq, Jordan, Pakistan, Somalia, the UK and the US can obtain a visa on arrival for 30 days at international airports, costing between 30-80 Euros. A proof of a health insurance valid in Iran might be necessary too.
It is generally possible to get an extension for the 15 days visa on arrival at the Police Office of Foreign Aliens in any major city of Iran. The extension gives you additional 15 days to your visa and it costs 300,000 Rials.
AS A NOTABLE EXCEPTION: The Kish Island, easily accessible from Dubai, does not require visas for visits of up to 14 days, including US nationals.