Ratings are a measurement of how many viewers are tuning in to a television show. The ratings are used to set advertising rates for television networks, determine the network's schedule, and even the content of the shows. Basically, to a network executive, ratings are everything.
Ratings are usually reported as points and shares. A ratings point is 1% of the market's total amount of households with televisions, meaning that for a national broadcast in the United States a ratings point is equivalent to 1,128,000 households. A share is the percentage of televisions on at the time that were tuned to that program. So a show with a "9.2/15" was watched by 9.2% of households with television, and 15% of households with televisions that were actually on at the time. For instance, the farewell episode of M*A*S*H had an astounding 60.2/77. It is possible to get a 0.0 rating and still have viewers. That just means that an insignificant number of the sample households were watching that show (or at least nobody actually being monitored for statistical data was watching). This is known in the industry as a "scratch", as a double quotation mark is printed in the ratings report to show that a ratings number could not be computed.
Besides the number of viewers, ratings companies also record the type of viewer, or demographics. In the US and forty other countries ratings and demographics are compiled by Nielsen Media Research, so sometimes the ratings are referred to as "Nielsens".
Besides automatic meters installed in some homes, the ratings companies will send out diaries to homes and pay people to accurately write down what they watch. These periods are called Sweeps, because the diaries used to be sent out to one region of the country and then the next, "sweeping" across the country. (Or, one could argue, this is the period where the networks want to "sweep" as many viewers to their offerings as possible.) More recently, ratings companies have made deals with DVR manufacturers like Tivo to use their DVR viewing statistics, which would theoretically increase the accuracy of the statistical data by increasing the size of the statistical data pool (as well as theoretically decreasing bias by shrinking the "visibility" of data collection). It's also probable that networks also look at stream numbers for episodes on their websites and Hulu, though these numbers haven't really been disseminated as broadcast ratings for advertisements remain the main metric for measurement. Notably, Netflix hasn't really delved very deep into the numbers for their original shows such as House Of Cards and Arrested Development.
Not to be confused with Media Classifications.
In some cases, networks may see ratings as more of a secondary concern. Publicly funded broadcasters such as The BBC in the UK, PBS in the US, or The ABC and SBS in Australia, have charters which they are expected (as public services) to fulfil, irrespective of how this affects their ratings. However, these are by far the exception rather than the rule.
Needless to say, ratings play a very large role in deciding whether a series stays on the air or not. It is quite possible that low ratings were responsible for the death of your favorite shows. To the average viewer or fan, ratings are the bane of their existence and completely throws quality out the window, because audiences just don't usually care about ratings.