Bit shaky on my AS but I believe it's because NaCl has a structure of giant ionic lattice which means the intermolecular forces are strong and require more energy to break than Cl2, which has weaker Van der Waals forces. Because it requires more heat energy the melting point will mean it's a solid whereas Cl2's boiling point will have been reached by room temperature so it'll be a gas