The atomic number is equal to number of protons present in the nucleus of an atom or vice-versa. For any atom, there is no change in number of protons either by adding or removal of electron.
Since, sodium is a metal, it has tendency to lose electron in the presence of non-metal i.e. chlorine. Thus, after lose of an electron, there is no change in the number of protons or number of protons will remain same.
Therefore, atomic number of metal is 11 which is also equal to the number of protons implies sodium will have 11 protons in its nucleus.