A gerund is a verb that ends in -ing and is used as a noun. Gerunds have several uses and serve as the subject of a sentence, as a complement, or even as the object.
An example of a gerund used as a subject:
Stargazing is an activity that must be done at night.