You can buy them locally at the airport or at a travel agent. The only problem is that flights are often booked out several days to week in advance, depending if you are travelling on a weekend or close to a major holiday. If you had lots of spare time, and had a flexible schedule, you could easily buy the tickets as you go.
When I went ot Iran all my flights were fully booked and they had even overbooked one flight, so they re-booked me on a later flight that day after I made some fuss (and probably kick someone else off that one).
As you only have 5 days in Iran and thus will have to adhere to a pretty strict schedule, you're better off buying them in advance rather than risk the chance of not getting to see the places you wanted because the flight there happend to be fully booked.
I checked on a flight booking engine and for random dates in May THR-SYZ-IFN-THR is € 88 ($134). Last year I paid € 61 for the same flights when I booked it directly with Iran Air, i.e. the difference is only about € 10 per segment.