Chemistry - How does an acid prevents or discourges oxidation of iron?

This is largely due to the extreme insolubility of iron (III) hydroxide, i.e. $\ce{Fe(OH)3}$.

One can write the oxidation reaction, somewhat simplified, as:

$$\ce{Fe^2+(aq) + 6 H2O(l) <=> Fe(OH)3(s) + 3 H3O+(aq)} + e^-$$

The $K_{sp}$ (solubility product) value for $\ce{Fe(OH)3}$ is very small: $2.79 \times 10^{-39}$ (Wikipedia).

From the equilibrium reaction it's easy to understand that acidic conditions (high $[\ce{H3O+}]$) push the equilibrium to the left, thus preventing the oxidation.

It also explains why Mohr's Salt resists oxidation much better than simple ferrous sulphate, as the ammonium ion provides some acidity.

In alkaline conditions the oxidation of ferrous ions to ferric ions is very fast.