Time and frequency have an "Unschärferelation" which mean that you need a certain time to be able to recognize a frequency with a particular certainty for a given precision and a given noisiness. A lot of other answers suggest that getting a whole period will magically allow you to recognize a frequency exactly while less won't. That's nonsense.
Assuming an exact measurement of a sine wave of unknown frequency, phase, and amplitude, three points will determine the sine wave. Those points may be almost arbitrary close.
But that does not answer the question of whether some frequency is part of a complex mixture with noise, and there is no sharp borderline.
As a rule of thumb, the frequency difference you want to be able to distinguish and the time span for examining the signal are indeed inverse, but there is a factor of proportionality coming in as well and also the overall expectation of noise.
The most compact probability distribution for a given energy is a Gaussian, and $\exp(-\pi t^2)$ has as its Fourier transform $\exp(-pi f^2)$. So we have here $\sigma_t^2 \sigma_f^2 = (2\pi)^{-2}$. This is a theoretical lower limit for compactness in time/frequency-space. Distinguishing frequency peaks of close frequencies requires suitably narrow distribution of the information in the frequency domain, requiring appropriately long measurement in the time domain.
A semitone corresponds to a factor of about 1.06, so telling two adjacent semitones at a bass frequency of 35Hz apart well requires a time window with a hand-waving duration of 300ms. In practice, we get along with a lot less because we do the pitch detection mostly on the overtones which have considerably higher frequency.
But if you use a rather overtone-lacking source of low notes, like an organ subbass windpipe, determining the exact notes in a fast bass run is just no longer possible. Add a mixtur or a reed pipe, and there is no problem whatsoever.
So basically: the higher the notes, and in particular the larger the frequency differences you want to be able to determine, the smaller the time interval you need for being reasonably sure.
A coloratura soprano can stuff as many notes into a phrase as she wants, and you'll hear every single note and how accurate it is (pity that the vowels all sound the same once the fundamental frequency leaves the speech formants behind). A basso profondo singing the same three octaves lower: not so much.
A bass recorder with its lack of overtones: quite a bit worse. Trilling on low notes is pretty pointless for that instrument.
To get back to your original question: half a second is actually sufficient for pretty much all pitch detection tasks. As the time interval shrinks, distinguishing frequency differences becomes harder, and this is spelling trouble first for the low notes where comparatively small frequency differences in Hertz already constitute a semitone of musical difference.