Each element is characterized by an atomic number denoted by Z, which is number of the protons. Proton is positively charged and neutrons are charge less, so the number of the protons decides the electric charge which decides the number of electrons of the atom in Non-ionized state. This is the basis of the chemical properties of a particular atom.
In the nineteenth century, scientists could determine mass of one atom relative to another by experimental means, and thus, Hydrogen, being lightest atom was arbitrarily assigned a mass of 1 (without any units) and other elements were assigned masses relative to it. However, the present system of atomic masses is based on carbon - 12 as the standard and has been agreed upon in 1961. Today Atomic mass is defined as One-twelfth of a mass of an atom of the carbon-12 (12C) isotope; a unit used for stating atomic and formula weights; also called a Dalton. It has a value of 1.660538921(73)×10−27 kg.
On this basis, the mass of Hydrogen atom is 1.0080 amu. Mass of oxygen - 16 (16O) atom is 15.995 amu. Amu is also denoted by simply u or Da.
Mass number or atomic mass is denoted by A. Mass number of an element is the number of nucleons viz. neutrons and protons. The energy required to break apart or split the nucleus of the atom into its component nucleons viz. Neutrons and Protons is called Nuclear Binding Energy. The atomic mass number is represented by a super index in left side such as The number 238 denotes that it has total 238 of nucleons.
However, due to the nuclear binding energy the mass of the atomic nucleus is always less than the sum of the individual masses of the nucleons. This mass difference is the measure of nuclear binding energy and is also known as Mass defect. Please note that nuclear binding energy is millions of times more than the electron binding energy. Mass defect is the difference between the mass of a nucleus and sum of the masses of the nucleons. In a nuclear reaction, the tremendous binding energy inside a hydrogen or uranium nucleus is released.
All the protons have a similar charge that is positive charge. To keep all the protons together which are similarly charged (positive), a nuclear force exists which is a very short range force and works within the nucleus. The concept of the nuclear binding energy gives an explanation to the non whole number of the atomic mass. For example the mass of 19F is 18.9984032 u.
Molecular mass is the sum of atomic masses of the elements present in a molecule. It is obtained by multiplying the atomic mass of each element by the number of its atoms and adding them together. For example, molecular mass of methane which contains one carbon atom and four hydrogen atoms can be obtained as follows:
Molecular mass of methane,
(CH4) = (12.011 u) + 4 (1.008 u)
= 16.043 u
Similarly, molecular mass of water (H2O)
= 2 atomic mass of hydrogen + 1 atomic
mass of oxygen
= 2 (1.008 u) + 16.00 u
= 18.02 u