For example, if a serving of food has 100mg of sodium, is that the same as weighing out 100mg of table salt or does the weight of the chlorine atom in each molecule need to be subtracted? Also, is kosher or sea salt also NaCl or is it a different molecule?
Correct, the amount of sodium in tablet salt is about half the weight of the salt.
The other salts are also NaCl, there can be some difference in iodine addition, flake size/shape, and trace minerals.
It’s just the mass of the sodium, excluding the chloride. One reason for this is that there are often other sources of sodium aside from table salt that are used as flavor enhancers (e.g. monosodium glutamate), preservatives (e.g. sodium benzoate), or emulsifiers (e.g. sodium citrate). You might have noticed that processed foods are often very high in sodium even if they don’t taste particularly salty, and the liberal addition of sodium compounds (aside from table salt) as preservatives and flavor enhancers is one reason why.