The distinction is pretty easy. "Das Mädchen" simply means girl (=female child), "das Kind" means child (= neutral), and for a male child or boy you would use "der Junge" (old-fashioned "der Knabe", southern dialects as well "der Bub(e)").
As far as I can see, the neutral gender for "girl" comes from the ending "-chen". This is a diminutive and always requires the word to have neutral grammatical gender. The origin of "das Mädchen" is "die Maid" (equal to maiden, meaning an adolescent), which is of female gender.
However, I once read in a grammer book that there is a difference in German between grammatical gender and real gender.
So it is correct to say:
"Da, das Mädchen! Es hat eine Schleife im Haar!" as well as "Da, das Mädchen! Sie hat eine Schleife im Haar".
This also works with some fairy tales characters like "das Rotkäppchen" (this is a girl, too):
"Rotkäppchen ging seine Großmutter besuchen." or "Rotkäppchen ging ihre Großmutter besuchen."
In spoken language, there is no real distinction when to use which. As a rough rule of thumb, you can go for the age: the older the girl, the more likely you will use the female gender instead of the neutral one. E.g., the first sentence of the "Schleife im Haar"-example builds up the picture of a girl around 4-5 in my head, while I rather picture a girl around 10-11 with the second one.
Also, as I just realized when building the sentences above ^^, it also depends on the actual form of the neutral pronoun. In many cases, the neutral pronoun equals the male one (like above the relative pronoun "seine" - means "its" or "his"). Then, it usually sounds somehow weird if you're talking about a girl (like in the Rotkäppchen example) or even a bit old-fashioned. Although it's not wrong, I would recommend to use the female pronouns in those cases.