Elements, which are composed of a single type of atom, contain different numbers of protons. Molecules are formed when two or more atoms bond together. If molecules contain atoms of different elements, that substance is known as a compound.