Number of iterations

If your Markov chain behaves well enough then effective sample size controls the error of your MCMC estimators, such as the mean (see https://betanalpha.github.io/assets/case_studies/rstan_workflow.html for more details). So you want to generate enough effective sample to be sufficient for your application. In general there is no unique answer.

For example, if I all I want to do is crudely locate the mean within the marginal posterior distribution then error[f] ~ sqrt{ Var[f] } / 3 should be sufficient and that implies

\sqrt{ Var[f] / ESS[f] } = error[f] ~ sqrt{ Var[f] } / 3
3 ~ sqrt{ ESS[f] }
10 ~ ESS[f]

Typically 100 effective samples allows for a more precise evaluation of the posterior properties.

Just keep in mind that all of this holds only if you have a central limit theorem, which means also checking for divergences, Rhats, and the like.