Mass is the amount of matter, i.e., the types of atoms and their quantities, that constitutes a given object. Thus it is a constant value that does not change regardless of the object's location. The standard unit for measuring mass is the kilogram.
The terms "mass" and "weight" are used interchangeably in ordinary conversation, largely because weight is also commonly measured in kilograms and is proportional to mass with identical gravity. However, the meanings of these two words are very different. Whereas mass is a measure of the amount of matter, weight is a measure of the force of gravity acting on that matter. Thus, unlike mass, the weight of an object will change with its location.
For example, a person's weight will vary slightly according to where they stand on the earth because of slight differences in gravity, their weight on the moon would be much less because of the moon's much weaker gravity, and their weight in zero-gravity space would be zero. However, there would be no change in the person's mass.
The mass of a helium atom is approximately four times that of a hydrogen atom because helium contains two protons and two neutrons while hydrogen contains only a single proton and no neutrons. (The mass of protons and neutrons is identical, but electrons have virtually no mass.) Likewise, a carbon atom has a mass of about 12 times that of a hydrogen atom because carbon has six protons and six neutrons.
Carbon dioxide has a greater mass (and therefore a greater weight) than nitrogen, which accounts for about 78 percent of the earth's atmosphere, and is thus heavier than air. This greater mass is because each molecule of it contains a total of 44 protons and neutrons (12 for the carbon atom and 16 for each of the two oxygen atoms) versus 28 for each nitrogen molecule (consisting of two atoms each with seven protons and seven neutrons).