NaOH is an ionic compound with strong electrostatic attraction between the oppositely charged ions. This means the melting point is high, as the bonds need a lot of energy to overcome. When dissolved, the ions are free to move and can carry the electric charge through.
H2O is a simple covalent molecule. To melt H2O, the intermolecular forces must be broken, which are weak so require little energy to do so. H2O, as it is covalent, does not have any ions to carry a charge so will not conduct electricity.