When water molecules are heated they move faster and collide more with the sugar molecules. These collisions transfer energy to the sugar molecules. Energy is needed to break bonds. The bonds holding the sugar molecules together or more likely to be broken.
The amount of sugar dissolved is dependent on the temperature of water.