A hydrometer is an instrument for testing the specific gravity (density) of any liquid. In beer and wine making, it is used to calculate the amount of sugar dissolved in the sample at any time.
Prior to fermentation, there will generally be a relatively large amount of sugar, either naturally present in the wort or must, or from added sugar, in the sample and this will cause the hydrometer to float quite high out of the liquid. As the yeast eats the sugar and turns it into CO2 and alcohol, the density (gravity) will drop and the hydrometer will sink further into the test sample.
You can also use a hydrometer to determine when primary fermentation has ceased and it is time to barrel or bottle your beer or wine. (Providing that you are at the target level stated by your beer or wine kit, when the hydrometer produces the same reading on two consecutive days you can safely assume that primary fermentation has ended.)