In a covalent bond, two atoms share electrons with each other. This distinguishes covalent bonds from ionic bonds, in which electrons are donated by one atom and accepted by the other.
In covalent bonding, both atoms generally share an equal number of electrons. Each covalent bond contains one pair of electrons. Sharing of electrons allows atoms to gain a stable electron configuration.
A molecule is a group of two or more atoms bonded together covalently. Molecules of covalent compounds consist of different atoms while molecules of elements have only one type of atom.
In many cases, an atom does not share all of its valence electrons. These non-bonded electrons usually appear in pairs and are lone pairs of electrons.
In a water molecule, the oxygen atom has two lone pairs of electrons.