Electricity can be defined as a flow or motion of electric charge. If a substance can allow such flow it is said to conduct electricity. Sodium chloride is made of positively charged sodium ions and negatively charged choride ions. Ions carry electric charges and therefore through their motion they could conduct electricity. Therefore, NaCl can conduct electricity if its ions are free to move.
In solid NaCl the ions are fixed in a ionic lattice and the electrostatic charges between the ions don't allow them to move freely, so solid NaCl won't conduct electricity. If you dissolve sodium chloride in an aqeous solvent (water), the ionic lattice breaks apart and the sodium and chloride ions are free to move around. Such solution will conduct electricity. Another possibility is changing the state of NaCl to a liquid. In molten NaCl the ionic lattice is also broken and the ions can travel around freely carrying electric charges and will conduct electricity.