When something dissolves, bonds within the solvent and solute break and new bonds between the solvent and the solute are made.
Generally speaking, substances won't dissolve if the bonds to be broken are stronger than those that will be formed.
There are two main types of solvent - polar (e.g. water) and non-polar (e.g. hexane)
Most ionic substances only dissolve in polar solvents because non-polar molecules don't interact strongly enough with ions to pull them away from an ionic lattice. The electrostatic forces between the ions are way stronger than any bonds that could form between a non-polar solvent molecule.
The ion-dipole bonds formed between ionic substances and polar solvent molecules are strong enough to dissolve the solid.
Most covalent substances only dissolve in non-polar solvents as the intermolecular bonds between covalent molecules tend to be pretty weak. They can therefore be broken by the non-polar solvent molecules.
Despite the intermolecular bonds being weak, covalent substances don't tend to dissolve in polar solvents.
Ionic compounds can be dissolved in water to make an aqueous solution. It's the polar H-O bonds in water that make it work.
Ionic substances can dissolve in water because:
H-O bonds are very polar so H atoms have positive partial charge and O atoms have negative partial charge.
Ion-dipole bonds can be formed between water molecules and the dissolved ions.
Positive charge on H atoms attracted to negative ions and negative charge on O atoms are attracted to the positive ions.
Ions separate from ionic lattice and become surrounded by water molecules.
The process of ions being surrounded by water molecules is called hydration and ions surrounded by water molecules are called hydrated ions. If the solvent isn't water, this process is called solvation.
Unless the ionic bonds in the lattice are really strong, the ion-dipole bonds will be strong enough to pull the lattice apart. This is why most ionic substances are soluble in water.