Covalent molecules may dissolve in water (a polar solvent) if the molecules are polar.  The molecules of the solute become surrounded by water molecules.  Dipole-dipole attractions form between the polar molecules and water molecules. 

Ions dissolve in water to a varying extent depending upon the strength of attractions.  When the ions dissolve they dissociate and form ion-dipole attractions with the water molecules.

Nonpolar molecules will dissolve in nonpolar solvents.  Since the molecules have no oppositely charged ends, they are not very attracted to each other and simply mix due to entropy - random motion and distribution.

Click here to see animations comparing covalent (sugar) vs ionic (NaCl) dissolving.

Click here to see ionic compound with polyatomic ions dissolving

Click here for animation of sodium chloride dissolving in water

Click here for animation of polyatomic ion dissolving