I will give a polite response, unlike the very rude person above. 'Cabello' is a masculine noun, and is not affected by the fact that the person is a girl.
Adjectives, however are affected, but if describing the hair (eg. the length), the adjective will be masculine, as cabello is masculine.
example: el cabello es corto. - the hair is short.
however, if you were describing the girl: la niña es baja - the girl is short.
I hope this is helpful :)
Since largo is the adjective describing "hair" which is a masculine noun, it takes the masculine form, regardless the owners' gender.
Now, if you wanted to say "the |long girl| has hair" you would certainly use larga, as it is describing the girl.
La niña tiene |cabello largo| La |niña larga| tiene cabello