Atoms that share electrons in a chemical bond have covalent bonds. An oxygen molecule (O2) is a good example of a molecule with a covalent bond. Ionic bonds occur when electrons are donated from one atom to another.
Each type of atom forms a characteristic number of covalent bonds with other atoms. An example of that is a hydrogen atom with one electron in its outer shell forms only one bond, its out most orbital becomes filled with two electrons.