Relation between size of ion and hydration energy
We can look at solubility as a competition between lattice energy and hydration.

$\Delta H_\text{solution} = \Delta H_\text{hydration} + \Delta H_\text{lattice}$

If the enthalpy of solution is exothermic or slightly endothermic, the compound will be soluble (we are ignoring entropy here).

If we take a simplified view of both lattice energy and enthalpy of hydration, we can see that they are both generally proportional to both the size of the ions as well as the charges, that is:

$$E \propto\frac{|q_1q_2|}{r} $$

Where $q_1$ and $q_2$ are the charges on the species in question and $r$ is the inter-nuclear distance.  So, ions with higher charges are more attracted to each other AND form strong ion-dipole interactions with water.  At the same time, larger ions experience weaker attractions to each other AND form weaker ion-dipole interactions with water.

It is important to remember that this simplified analysis does not take lattice structure and crystal packing into account at all.

The differences in solubility between different ionic compounds follows two general trends.


Mismatch in Ion Size
In general, when there is a difference in the size of the ions in a compound, the compound is more soluble.  This probably arises from poorer packing in the solid state.  For example at room temperature, $\ce{MgSO4}$ has a solubility of 1.16 g/100mL while $\ce{BaSO4}$ has a solubility of $2.45*10^{-4}$ g/100mL$^{[1]}$.  The barium ($159$ pm) and sulfate ($242$ pm) ions are much closer in size than magnesium ($86$ pm) and sulfate$^{[2]}$.
Covalent Character
In general, the more covalent character present in an ionic compound, the lower it's solubility.  We can estimate covalent character by looking at the difference in electronegativities of the ions in the compound.  The larger the difference in electronegativities, the less covalent character in the compound.


For example, $\ce{AgF}$ has

$\Delta \mathrm{EN} = (4.0 - 1.93) = 2.07$

Solubility = $\dfrac{180}{100} \mathrm{~g~mL^{-1}}$

While $\ce{AgCl}$ has

$\Delta \mathrm{EN}= (3.5 - 1.93) = 1.57$

Solubility = $\dfrac{0.193}{100}\mathrm{~g~mL^{-1}}$

In summary, the solubility of ionic compounds is greater when there is a significant size difference between the ions and when there is a greater difference in their electronegativities.

Footnotes



[1] Tro et al, Chemistry, A Molecular Approach, 2nd Canadian Edition

[2] https://en.wikipedia.org/wiki/Ionic_radius