This is because "long" can be both an adjective and a noun.
* Adjective: She has long hair. (Describing the length of her hair)
* Noun: We took a long walk. (Describing the duration of the walk)
Therefore, "long" is a homograph because it has the same spelling but different meanings and grammatical functions.