Dissolving involves enthalpy changesWhen a solid ionic lattice dissolves in water, two things happen: The bonds between the ions break to give free ions - this is endothermic. Bonds between the ions and water are made - this is exothermic. The enthalpy change of solution is the overall effect on the enthalpy of these two things. Water molecules can bond to the ions because oxygen is more electronegative than hydrogen, so it draws electrons towards itself, creating a dipole. The dipole means the positively charged hydrogen atoms can form bonds with the negative ions and negatively charged oxygen atoms can form bonds with positive ions. Substances generally only dissolve if the energy released is roughly the same or greater than the energy taken in. So soluble substances tend to have exothermic enthalpies of solution.
Enthalpy change of solution can be calculatedYou can work out the enthalpy change of solution using a Born-Haber cycle. Imagine that, instead of dissolving the compound directly, you are going to break the lattice into separate gaseous ions and then dissolve the gaseous ions in water. Both of these are standard enthalpy changes that you can look up - the lattice dissociation enthalpy and the enthalpies of hydration of the ions. So you can use the to construct a Born-Haber cycle to find the enthalpy change of solution.