By definition, one mole is equal to the number of atoms in 12 grams of carbon-12. This is known as Avogadro's number, sometimes expressed as 6.022 x 10^23. To determine the moles in a sample of any element, you need to refer to the Periodic Table.
Determine the atomic mass of the element
The mass of a single mole of an element is roughly equal to its atomic weight. The atomic weight of each element is listed on the Periodic Table. Oxygen, for example, has a weight of almost exactly 16 (15.999). This means that a mole of oxygen weighs 16 grams.
Weigh the sample
Weigh the sample using a mass spectrometer if the weight isn't already known, and divide the total weight by the element's atomic number to arrive at the total number of moles in the sample. The relationship between weight and molar count is linear. For example, 16 grams of oxygen equal a single mole, 32 grams equal 2 moles and 24 grams equal 1.5 moles.
Convert moles to atoms
To convert a molar count to an exact count of atoms, multiply the number of moles by Avogadro's number. For example, a 32-gram sample of oxygen, or 2 moles worth of oxygen, contains 2 x (6.022 x 10^23) atoms.