In the nominative case: der = masculine, die = feminine, das = neuter. They may suffer variations depending on the case, for example in the accusative case, "der" becomes "den".
Why is it called masculine/feminine/neuter? No idea, because the "gender" of the word won't tell you much. For some reason, "the girl" is "das Mädchen", instead of what you'd probably guess, "die Mädchen". In the same way, fishes come in different genders (male fishes, female fishes), so you'd expect it to be "das Fisch", yet is actually "der Fisch", even though you can also have female fishes.
So, you can't really determine the gender of a word. Every single word has a gender, and that is just the way the language works (unlike English, but similar to Portuguese, Spanish, Russian, etc.). The best strategy is to memorize not "Frau", but rather "die Frau". I'm pretty sure that once you become more fluent, you'll start to develop an intuition and be able to guess what is the gender of X word, but for now, you'll have to memorize it, as there is no apparent rule to determine it anyway.
There actually are some rules they can help you determine what gender a word is supposed to be. For example, diminutives tend to be neuter. And that's why Mädchen is "das"!
Incidentally, the little-boy equivalent of Mädchen is "das Jungchen" (neuter) while the non-diminutive form is "die Magd" (feminine).