The difference between salt and sugar, specifically sodium chloride and sucrose, the particular salt and sugar most often used by people, is in their elemental composition, the types of bonds that hold them together and the way they dissolve in water. Salt and sugar can appear almost identical on casual inspection, both being white, crystalline solids. However, despite the fact that both are water soluble, they have vast chemical differences.
Sodium chloride and sucrose share no elemental components at all. Sodium chloride, as the name implies, is composed entirely of sodium and chloride ions with ionic bonds between them. Sucrose, on the other hand, is composed of carbon, hydrogen and oxygen held together with covalent and polar covalent bonds. While both are water soluble, the solubility of sucrose increases greatly with the temperature of the water, while the solubility of salt is largely independent of temperature.
When these compounds do dissolve, they do so in very different ways. Sodium chloride is an ionic solid, and when it dissolves in water, its individual sodium and chloride ions are dissociated from one another. Sugar molecules, on the other hand, maintain the bonds between their constituent atoms when dissolved, and thus remain as whole molecules in the solution.