In physics, "mass" always refers to "rest mass". In some older books and unfortunately many high school level physics books, the concept of "relativistic mass" is introduced, which increases as a function of speed. But this is then nothing more than the total energy of the object, therefore a redundant concept.
Now, the mass of an object is, as Einstein has shown, equivalent to the total energy content of that object in rest up to a conversion factor of $c^2$. The reason why $c^2$ appears here is because we use incompatible units for lengths and time intervals and then the formulas will have to compensate for our bad habits. The meaning of $E = m c^2$ is made visible much better in natural units where $c = 1$; obviously $E = m$ conveys far more clearly that mass and rest energy are one and the same thing (so, it's not that energy can be converted to mass or vice versa).
So, back to the mass of the elements, an atom has a total energy relative to the vacuum when that atom is not present, that energy difference is the mass of the atom. This means that we could just as well eliminate the concept of mass and only talk about the rest energy. I guess we don't do this for historic reasons and because "mass" just takes 4 letters to write. But in physics it is customary to use c = 1 units and denote the mass of particles in energy units like e.g. GeV.