Both H2O and NH3 are polar molecules. The electronegativity of nitrogen and oxygen atoms are 3.0 and 3.5, respectively. So, the oxygen-hydrogen bond in H2O is more polar than the nitrogen-hydrogen bond in NH3. As a result, H2O molecules can form stronger hydrogen bonds with each other.
The stronger hydrogen bonds in H2O lead to higher boiling point, higher melting point, and higher surface tension compared to NH3.