Within the chlorine molecule, there are covalent bonds present between each atom of chlorine. This results in the formation of simple molecules, meaning there are no bonds between molecules of chlorine. As a result of this, chlorine has a low boiling point so is a gas at room temperature.
On the other-hand, sodium chloride has ionic bonds present in the molecule. These are strong bonds that occur in all directions between oppositely charged ions, Na+ and Cl-. This results in the formation of a giant lattice structure, which requires a large amount of energy to break the bonds. As a result of this, sodium chloride has a high melting point so is a solid at room temperature.