Water is made up of hydrogen and oxygen atoms. These atoms were made just after the "Big Bang". Oxygen and hydrogen combined to form H2O or water.
The water formed was mostly in the form of vapour and got mixed with the cosmic dust to reach the surface of the earth. When earth was formed, these water vapours cooled down to form oceans, seas, rivers lakes and other water bodies.