Gerunds are nouns. Nouns function as subject and objects:
Swimming is fun. <subject>
I like
swimming. <object>
Nouns can be replaced by pronouns, like this,
It is fun. <pronoun: It = Swimming>
I like
it. <pronoun: it = swimming>
Now let's look at your example sentence:
Watching television can be a waste of time.
Question 1: What's the subject?
Question 2: Can we replace the subject with a pronoun?
If you answer "Yes" to both questions, then "Watching television" is a gerund.