The particle 'soup' that formed from the Big Bang cooled about 380,000 years after the event, to form atoms. It created mostly hydrogen, a little hydrogen, and trace amounts of lithium. So, all the hydrogen on Earth - in all the molecules of water - have been around since atoms have been able to exist - a little over13.5 billion years now. (The Big Bang is thought to have occurred about 13.88 billion years ago.)
The first stars were made with almost 100% hydrogen; The availability of hydrogen - dense in the beginning - allowed some very large stars to form, which fused the hydrogen into heavier elements - helium, carbon, calcium, oxygen, etc., then they exploded, spreading these atoms into the cosmos.
Our solar system is thought to contain the atoms from these stars - so, the oxygen you're breathing, the iron in your blood, the calcium in your bones - all came from the hearts of huge stars that lived, died, and exploded billions of years before our solar system came to be.
So, that's how *atoms* were made; compounds - like water, glucose, sugar, salt - are combinations of atoms. There are two types of bonds that form compounds - they can share electrons (covalent bonds, like the oxygen and hydrogen in water), or they can be attracted electrostatically like sodium and chlorine, in salt). Compounds can be made up of many atoms or just a few; while we only know of about 120 elements, there are thousands of compounds.