How many hydrogen bonds in these compounds?
Hydrogen bonds require a $\ce{\delta{+}}$ hydrogen atom capable of forming a hydrogen-bond, so $\ce{H2O}$ makes 2 H-bonds, and $\ce{NH3}$ has 3 H$\ce{\delta{+}}$ atoms capable of forming these bonds.

However hydrogen bonds also require an "active" lone pair capable of accepting a hydrogen-bond, where $\ce{H2O}$ can do 2 of these again, but $\ce{NH3}$ can only accept 1.

So, does water make 4 bonds or 2? Does ammonia make 1 bond or 2?  The answer is both, but it depends on how you count it.  If you look at an individual molecule in a cluster of water molecules it may appear to be surrounded and held in place by four H-bonds; it makes two with the hydrogen and accepts two with the lone pairs.  That molecule is involved in 4 hydrogen bonds.

But if you take 100 water molecules and count how many hydrogen bonds there are between them, the answer will be about 200 because each molecules makes 2 bonds.  If you consider each molecule making 4 bonds then you are double counting each bond being made and accepted.  The same is true for ammonia, each molecule makes one hydrogen-bond, it also accepts one.  You could say that an individual molecule is involved in two bonds, but if you count them all up each molecule only makes one each.

Because of these two different viewpoints, some texts will say water makes 4 and alcohols make 2 bonds, and some will say water makes 2 and alcohols make 1 bond.  They are both right, but right in different ways. Whichever way you count them, you must be consistent. If this is related to an exam syllabus, the correct way is defined by that.