Musical notation is organized by measures which divide rhythm into manageable portions. A measure is the period of musical time between two adjacent bar lines. A time-signature is a fraction that appears in music notation indicating the quantity and organization of note & rest values within the measure(s) that follow.
Beginning students are taught that:
the top number shows how many beats per measure, and
the bottom number shows what note-value gets one beat
This explanation is sufficient for beginners, but it is not accurate in all cases.
Generally, a time-signature describes the relationship between one measure and a whole note. The bottom number (denominator) shows the fraction by which a whole note is sliced (as a "pie"), and the top number (numerator) shows how many of those slices are contained in a measure. For example, in 3/4, the bottom number shows that the whole note is divided into 4 equal slices (quarters), and the top number shows that each measure contains 3 of those slices (3 quarters of a whole).
If the value of the fraction formed by the time-signature equals one, (e.g. 1/1, 2/2, 4/4, 8/8) then one whole measure can contain one whole note. If the value is smaller than one (e.g., 2/4), a whole note won't fit into a measure, and if it is greater than one (e.g., 5/4), than more than a whole note will fit into the measure.
A whole note acts like a variable, i.e., with no intrinsic value. It is commonly assigned a value of four beats. The names of the other note values are derived as fractions of the whole (e.g., half-notes, quarter-notes, etc.). They too have no intrinsic value, but are commonly assigned values based on their fractions of the 4-beat whole note.
The denominator of the time-signature in most cases shows the note value per beat; but this is not a reliable rule. Ternary (also called "compound") time-signatures like 3/8, 6/8, 9/8 and 12/8 are notable exceptions, where it is most commonly the dotted-quarter --and not the 8th note-- that is perceived as a beat. A dotted-quarter is equal 3/8 of a whole note. So, in order to follow that previously mentioned rule, the time signature should show 3/8 in the denominator (i.e., the whole is divided into slices of 3/8). However, time-signatures don't include fractions in the denominator position. The denominator of a time-signatures is limited to simple, non-dotted values of either 1, 2, 4, 8, 16, 32 (whole, half, quarter, eighth, sixteenth, or thirty-second).
As far as defining the "beat" in a section of music, this can be ambiguous at times-- especially where the pulse could subjectively be felt at more than one rate. The time-signature does not definitively establish a note-value per beat. Time-signatures in quarter time (X/4) are very often interpreted as a quarter-note getting a beat.
The ambiguity about what note value gets one beat may sometimes require the reader to make a reasonable guess. That guesswork can be eliminated through additional text, e.g., "In 2" or, "Quarter note = 105 BPM". When you transition from one time-signature to another, additional text can be shown above the time-signature to clear up the ambiguity about how tempo and/or note values are carried over from the previous time-signature to the next. In the absence of additional text, it may be left to the performer or conductor to interpret what was intended by the composer.
Meter is a term that refers directly to the rhythmic patterns in music, and the way beats are divided and grouped. A Time-Signature is a label that helps to define the framework for the meter of a section of music.
A time-signature has an associated default beat division. Quarter-time signatures (with a 4 in the denominator) imply a beat division of 2 or 4. Ternary time-signatures (3/8, 6/8, 9/8, 12/8, etc.) suggest a beat division of 3 or 6. At any moment in the music, a beat can be divided differently than the default beat division through the use of an ad hoc tuplet. Triplets in quarter-time (X/4) are the most commonly used tuplet. A "3" above a beamed or bracketed group of three notes, indicates that three notes are played in the time that would normally be occupied by two such notes. Generally, a tuplet will use the beaming of the closest note value. If there is an ambiguity about the tuplet, a ratio will be shown. For example, "5:4" over a beam group of 8th-notes, means five 8ths in the space of four; "8:6" over 16th notes in 6/8 would suggest eight 16th notes in the space of six. Though the component notes of tuplets may be called quarters, or eighths, or sixteenths, etc., those names only refer to the note/rest symbols and not their new tuplet values. An 8th note triplet would more accurately be called a "12th" note as it is 1/12 of a 4-beat whole, but for unknown reasons, that terminology is not often used.
A composer can use a time-signature to provide information about how to count and play a section of music. With more unusual time-signatures, like 7/8 or 11/16, etc, the time-signature might show the top number broken up into subgroups. For example, 5/8 might be shown as 2+3 over 8, or 3+2 over 8 to help prepare the reader for how the meter is interpreted. Sometimes a complex time-signature combines two or three simpler signatures. For example, 6/8+3/4 (shown one after the other) might indicate a common 8th note grouped as 3+3 (6/8), then 2+2+2 (3/4). Often, such pairs of measures might be separated by a dotted bar-line.
In practice, time-signatures often invoke a customarily accepted system that allows the reader to interpret notation based on norms. Given a tempo, a time-signature, and sometimes a confirmation of which note-value gets a beat, the reader is then ready to interpret the music.