When a crystal is placed into a solvent, the molecules/ions in the crystal become dissociated and are solvated by the solvent. The process stops when there is equilibrium between crystal and solution of molecules/ions plus solvent. At this point the solution is saturated but only if some solid is still present in contact with the solution. At this point the free energy is at a minimum.
Some molecules/ions will always dissociate from the crystal due to the entropy gain by diluting or mixing, with the solvent. The solubility then depends on whether these molecules/ions are more stable in the solvent than in the crystal.
(These process do not indicate how quickly a crystal will dissolve. That depends on the activation energy barrier to leave the crystal and enter solution, not on the relative energies of the crystal and solvated molecules/ions).
In an ionic crystal the ions are held together by Coulombic forces, which are of long range and have a $1/r$ distance dependence. To determine the accurate binding energy in a crystal all interactions with other ions have to be accounted for, not just nearest neighbours. This is a standard calculation the most difficult part of which involves finding the Madelung Constant for the particular crystal.
At the surface of the crystal the interactions are far smaller than the bulk as these molecules/ions are in contact with only half of the crystal's ions and they also interact with the solvent. To estimate the solubility, the Coulomb energy of separating two ions to a distance r in a solvent of dielectric constant (relative permittivity) $\epsilon$ is calculated. This energy is $$w =\frac{z_1z_2e^2}{4\pi\epsilon_0\epsilon r}$$
where $\epsilon _0$ is the permittivity of free space, e the electronic charge and $z_i$ the charge on ion i and the energy at $r=\infty$ is taken to be zero.
The Coulomb law is not really valid at small separations, because of the molecularity of the medium makes the continuum assumption, in terms of the dielectric constant, to break down. Nevertheless it does give an insight, albeit, approximate into solvation.
The free energy for separating two ions with radii $r_+$ and $r_-$ is thus $$\Delta\mu \approx \frac{+z_1z_2e^2}{4\pi\epsilon_0\epsilon (r_+ + r_-)}$$
which is positive since the coulomb interaction will always be negative for combining opposite charges.
The Boltzmann distribution for the concentration $X_1$ and $X_2$ in two co-existing phases is
$$ X_1=X_2exp(-\frac{(\mu_1-\mu_2)}{k_BT})=X_2exp(-\frac{\Delta\mu}{k_BT})$$
If we associate the concentration $X$ as a mole fraction then this can be a measure of the solubilty, $X_s$, thus
$$ X_s \approx exp(-\frac{(\Delta\mu}{k_BT})=exp[-\frac{e^2}{4\pi\epsilon_0\epsilon k_BT}\frac{1}{(r_1+r_2)}]$$
In water the mole fraction solubility of NaCl is $0.11$ which is a larger than the calculated $X_s =0.08 $, but not by much considering the simplicity of the model.
The last equation has the general form $$X_s = exp(-C/\epsilon)$$
where $C$ is a constant depending on the ion pairs and temperature. Thus a plot of logarithm solubility (as mole fraction) vs. reciprocal of dielectric constant for the same ion pairs in different solvents should give a straight line. The plot below shows data for NaCl in different solvents, the approx relationship is borne out. Because of the reciprocal nature of the ionic radii in the equation, larger ions should generally be more soluble than smaller ones.
The solvents($\epsilon$) from points left to right are methylformamide(182.4), formamide(109.5), water(78.5), ethylene glycol(40.7), ethanolamine(37.72), methanol(32.6), ethanol(24.3), propanol(20.2),butanol(17.8), pentanol(13.9). ( Data adapted from J. Israelachvilli, Intermolecular and Surface Forces).
The huge range of solubility is quite dramatic, and shows that the main effect on solubility is due to the solvent dielectric constant $\epsilon$. You can appreciate this from the Coulomb law. The electric field around an ion is effectively 'quenched' in a high dielectric meaning that the interaction energy decreases rapidly with distance. Thus an ion effectively becomes isolated from all others and is surrounded only by solvent dipoles. In a low dielectric the electric field of the ion and spreads out to a far greater distance (in the ratio of dielectric constants which could be 20 times larger), thus one ion can 'feel' the effect of others nearby when they diffuse close to one another and if they are attracted then they can coalesce to form an ionic molecule, and thus are no longer soluble.
In the figure all these solvents are rather similar and hydrogen bonding solvents to a greater of lesser extent. Non hydrogen bonding solvents are less effective it seems for solvating ionic compounds, for example, the solubility of NaCl in acetone ($\epsilon = 20.7$) is $X_s=10^{-7} $ far smaller than for propanol with a similar $\epsilon$