Like many things in music notation, there's the answer we often first give - the top number is the number of beats in a measure, and the bottom one tells you the note value that represents one beat - and there's the more complete answer that's a lot more refined and correct.
There are two main kinds of time signatures, simple and compound. (There are more types than these two, but let's leave that for another question.) :-)
Simple meter (meter is another word for "time signature") is easy: the top number represent the number of beats in a measure, while the bottom one represents the note value (whole, half, quarter, eighth, etc.) that represents one beat. Simple meter is also easy to recognize because the top number is one, two, three, or four.
Compound meter is not so easy: The top number represent the number of divisions of the beat (in the case of compound meter, the beat divided into three equal parts), while the bottom number represents the note value equal to one division of the beat. Compound meter may be confusing in this respect, but it's easy to recognize since the top number is six, nine, or twelve.
There is much more that could be said about simple and compound meter, but to make this a relatively short but refined answer, I'll leave it at that. I'd be happy to go into more detail about this fascinating aspect of music notation. ;-)