They use the Nielsen Ratings which are survey results. Except instead of calling everybody up they hook a box up to your TV if you are selected that records everything you watch. I believe they also have you enter a code on the remote when you sit down to watch so they record who is the household is watching what. They also know how long you watch the program so if you only watch half of a program you are counted as half a viewer.
On Youtube, as soon as the video starts you are counted as a viewer even if you don't watch the whole thing. If you watch 5 TYT clips you will be counted as 5 viewers. Also the TYT Youtube numbers are for the whole day and not just 1 hour.