Molecules are formed when two or more atoms are joined chemically through covalent bonding. The atoms can be of the same element or different elements. If the molecule is formed by more than one element, it is referred to as a chemical compound.
The properties of a molecule are a result of the elements involved and the properties of the covalent bonds that hold them together. Covalent bonding occurs when atoms share electrons, which creates a bond that doesn't dissociate easily. The difference in electronegativity values between atoms determines the type of bond that is formed. If electronegativity values are very similar, a nonpolar covalent bond will form. If the difference in electronegativity values is significantly different but not greatly so, a polar covalent bond will form. The polar bonds in a molecule can add to the overall polarity of the molecule and give it special properties as a polar molecule.
Ionic bonds occur when there is a great difference in the electronegativity of two atoms. Ionic bonds involve the transfer of electrons from one atom to another to create charged ions that bond together. Ionic compounds are not molecules. Because covalent bonds only form between nonmetals, molecules will only be comprised of nonmetallic elements.