During the electrolysis of (\text{NaCl}\), irrespective of concentration, the product formed at the cathode is always hydrogen.
In case of dilute NaCl solution, H2O is preferentially oxidised at anode, since H2O is higher in electrochemical series of anions than Cl−.
But, H2O and Cl− are very close in electrochemical series of anions.
Though H2O is above Cl− but Cl− ions are more in numbers than H2O molecules in a concentrated NaCl solution.
This alter the preferential oxidation at anode and Cl− ions get oxidised at anode in case of concentrated NaCl solution.