The Fourier transform assumes the signal is analysed over all time - an infinite duration.
This means that there can be no concept of time in the frequency domain, and so no concept of a frequency changing with time. Mathematically, frequency and time are orthogonal - you cannot mix one with the other. But we can easily understand that some signals do have frequency components that change with time. A piano tune, for example, consists of different notes played at different times: or speech can be heard as having pitch that rises and falls over time.
The Short Time Fourier Transform (STFT) tries to evaluate the way frequency content changes with time:
The diagram shows how the Short Time Fourier Transform works:
Each frequency spectrum show the frequency content during a short time, and so the successive spectra show the evolution of frequency content with time. The spectra can be plotted one behind the other in a 'waterfall' diagram as shown.
It is important to realise that the Short Time Fourier Transform involves accepting a contradiction in terms because frequency only has a meaning if we use infinitely long sine waves - and so we cannot apply Fourier Transforms to short pieces of a signal.