It has an "-ing" ending. Please note that all verbs ending in "-ing" are not gerunds. Present participles also have the same form.
It is easy therefore to confuse it with a present participle. Hence, we cannot depend on morphology alone to identify (recognize) it. We need to look also at the work it does in a sentence.
The Syntax of the Gerund
The Gerund does the work of a noun in a sentence. This means, it can be any one of the following:
The subject of a verb, as in the sentence... Swimming is good exercise. The word swimming is the subject of the verb is.
The object of a finite verb, as in... You enjoy learning a new language. The word learning is the object of the finite verb enjoy.
The object of a non-finite verb... She intends to begin writing the story soon. The word writing is the object of to begin, an infinitive (i.e. a non-finite verb).
The object of a preposition... He is interested in joining the group. The word joining is the object of the preposition in.
The indirect object of a verb... She gave reading great importance in her life. The word reading is the indirect object of the verb gave.
All these functions which the Gerund is shown doing are usually those of a noun. Depending on the function, the grammatical case of the gerund will be nominative or accusative or genitive, etc.
The Semantics of the Gerund
You know that the noun is a name. The Gerund is also a name. It's the name of an activity.
In so far as it is an activity, it is a verb.
In so far as it is a name, it is a noun.
Avoiding Confusion
Sometimes, not only the morphology, but also the syntax may lead us to believe a word is a present participle. At such times semantics helps us to recognize a Gerund.
Here are two examples:
walking stick - the word walking looks like an adjective describing stick...but it is not.
walking stick is not a stick which walks. It is a compressed form of "stick for walking". So walking is the object of the preposition for. So walking is a Gerund.
reading room - the phrase does not mean that the room reads. It is a compression of "a room for (the purpose of) reading". So reading is a Gerund.