There is no clear distinction, as pointed out in Ralph Mayer's handbook, apart from how brands choose to name their paints and a vague understanding that gouache is supposed to be more opaque than watercolor (but many brands of gouache contain some transparent colors, and many brands of watercolor include opaque white). So watercolor/gouache would be the only medium (to my knowledge) that is classified according to how you use it, which is a bit silly.
Interesting side note: I have read some technical examinations of ancient Egyptian wall paintings. For the most part, they ground their colors in gum arabic, and applied it in rather opaque flat areas of paint. So you could say that the Ancient Egyptians painted in gouache
Some of the paintings seem to have been glazed (or "varnished") with egg white afterwards.