What's happening is exactly what the others are saying - molecular movement is the foundation. But I want to add a detail you might not have considered: hot water doesn't just dissolve sugar faster, it also does it because it can "hold" more dissolved sugar. I mean, cold water has a limit to how much sugar it can dissolve, while with heat that limit goes up. So if you add a lot of sugar to cold water, some will always stay undissolved even if you wait, but in hot water it magically disappears.
The practical trick that few people use is this: if you need to dissolve sugar quickly in cold water (maybe you're making iced tea or whatever), you don't need to wait for the kettle. Just mix the sugar with a spoonful of hot water in a cup, make a smooth paste, and then add the cold water. The sugar already dissolved in that small amount mixes right in with the rest without forming lumps. It's the method I use when I'm in a hurry and don't want to wait for the water to cool down.