Electrolytes are substances which carry current when they are in an aqueous solution. The current arises due to the movement of ions from one electrode to another. All the compounds which are ionic in nature are termed electrolytes.
The dissociation of ions leads to the conduction of electricity by the transfer of electrons whereas non-electrolyte are the substances which do not carry current in the aqueous solution. The compounds like sugar and ethanol do not produce ions when dissolve in water.
So, when the ionic compounds dissolve in water they produce ions. The ionic compounds are electrolytes.