Each of these can be thought of as a conversion factor. Typically, you're converting everything to or from beats (which are the basic unit of time in music). If you recall "dimensional analysis" from high-school physics, this is a great place to use it!
- Time signature numerator = beats/bar
- Time signature denominator = beats/whole-note (i.e. what division of whole note is a beat)
- Tempo = beats/minute
However, there is the additional caveat that the "beats" in the tempo may not be the same as the "beats" in the time signature. In this case, you have to compare the note in the tempo marking with the time signature denominator. This typically happens in compound time, as explained by Dom and Bob Broadley.
So if you were looking for the actual time duration of a note, you'd use the time signature's denominator to determine how many beats (or what fraction of a beat) are allotted to that note. Then you'd use the tempo to determine the length of time in a beat (possibly accounting for different definitions of beat if needed).
I was asked to give an example, presumably of finding the duration of a note. It should go without saying that this isn't something that any musician would ever need or want to think about while playing (especially since the actual tempo will often be somewhat variable during performance), but that doesn't mean there might not be a reason for someone to do it (such as when programming a computer).
For this example, let's say the time signature is 6/8, the tempo is a dotted quarter at 108 bpm, and you want to know how long a quarter note (or two tied eighth notes) lasts. From the tempo, we know there are (108 dotted-quarters / minute). We also know that our note's duration is 2/3rds the duration of the tempo unit (our quarter note lasts two eighths, while the tempo unit is three eighths). This gives us the formula below. Note that because each of the ratios below is exactly equal to one by definition, I can "flip" them as needed, in order to ensure that the units cancel out properly.
(60 seconds / 1 minute) * (1 minute / 108 dotted-quarters) * (2 dotted-quarter / 3 quarters)
= (60 * 2) seconds / (108 * 3) quarters
= (120/324) seconds / quarter note
= 0.370 seconds / quarter note
You'll also notice that (aside from affecting the unit the tempo is measured in) the time signature never enters into this equation. That's because the time signature is used for finding the length of a bar (or measure), which has no direct bearing on the duration of the note. So what if you wanted to find the length of a bar? The calculation is very similar, but note where the 6 (from the time signature) comes into play.
(60 seconds / 1 minute) * (1 minute / 108 dotted-quarters) * (1 dotted-quarter / 3 eighths) * (6 eighths / bar)
= (60 * 6) seconds / (108 * 3) bars
= (360/324) seconds / bar
= 1.111... seconds / bar
Addendum for MIDI Files
If you're working with MIDI files and sequencers, you may also come across a quantity called "ticks" or "Pulses Per Quarter Note" (PPQN) which defines the temporal granularity of the events in that file. This doesn't directly reference either beats or real-time units, so there's a bit of conversion necessary. For example, assuming the tempo unit matches the time signature denominator:
ticks per second = (ticks/quarter-note) * (quarter-note/beat) * (beats/minute) * (minute/second)
= PPQN * (4/denominator) * (tempo/60)