Humidity is measured at weather stations over land, and by ships and buoys over the oceans. The most common instrument is a wet bulb thermometer.
The thermometer bulb is covered by a muslin wick which is kept wet because the other end of the wick is in a reservoir of water. The air evaporates this water. Energy is needed for evaporation to happen, so the air is cooled a little by the evaporation resulting in the wet bulb thermometer measuring a lower temperature than a thermometer without a wick (a dry bulb thermometer).
The relative humidity (RH) and other humidity variables can then be calculated from the wet bulb temperature and the dry bulb temperature. These pairs of thermometers are often called psychrometers. More modern instruments are now available called capacitive sensors. These measure voltage which depends on the amount of water vapour in the air. Voltage is then transformed into either RH or dew point temperature.
Humidity above the surface can be measured using similar instruments suspended from a helium balloon that is allowed to float up through the atmosphere - a radiosonde. Satellites can also be used to infer either the amount of water vapour or the relative humidity. Recently, GPS signals have been used to infer the amount of water vapour as signal timing is affected by water vapour quantity.