When NaCl is added to water, it dissolves into ions, Na+ and Cl-, since NaCl is a salt and a strong electrolyte. The resulting solution will have a neutral pH since NaCl is a neutral salt.
When HCl is added to water, it dissolved into ions as well, H+ and Cl-, since HCl is also a strong electrolyte. The resulting solution will have a pH of less than 7 since the H+ ions will increase the acidity of water.