Elementary particle interaction crossections and lifetimes are calculated in perturbative expansions that are set up using Feynman integrals.

The wavy line represents the exchanged boson , in this case a photon which has zero mass. The wavy line in the integral is the propagator of the electromagnetic interaction in this case. In momentum space the propagator is
$$ \frac{1}{p^2-m^2+\mathrm{i}\epsilon}$$
where $p$ is a four momentum and $m$ in this case is 0. This means that the contribution of this term in the integration can be reasonably large, depending on the phase space limits of the integral. (The iε is there to be used as going to the limit of zero when integrating over the singularity)
When the mass is large, as in the W or Z exchanges, the propagator suppresses the integral by orders of magnitude for energies below their masses. That is what makes the probability of interaction short range.
Alternatively, when viewing interactions through the Yukawa potential, which is essentially obtained as the Fourier transform of the propagator, it is seen that zero mass exchanges end up corresponding to a long range 1/r potential, while a massive mediation boson with mass $\mu$ leads to the Yukawa potential
$$V(r) = -\frac{g^2}{4\pi}\frac{\mathrm{e}^{-\mu r}}{r} $$
and if $\mu$ is a large mass the potential falls exponentially fast.
Postscript: The strong interaction described by QCD has a zero mass gluon as the mediator, but gluons have color charge and the potential built up is not a Yukawa type potential, but follows

It is a very short range force from this potential which leads to confinement of quarks and gluons within the hadrons.