If we want to know frequencies in a signal over time I know we can use Short-time Fourier transform (STFT). but I read in a paper "The spectrogram representation was obtained by first filtering the speech stimulus into 16 logarithmically spaced frequency bands between 250 and 8 kHz" so it seems they defined 16 bandpass filter and filter the data. I want to know how different are these two methods?
STFT is also bandpassing. The method the quote refers to is likely the Continuous Wavelet Transform. The fundamental difference is, STFT uses fixed-resolution kernels spaced linearly, while CWT uses varied-resolution kernels spaced logarithmically.
Example CWT filterbank in frequency domain (source; x axis from 0 to pi radians):
An STFT with Gaussian window would have same shaped filters, but with fixed width and peaks incremented linearly. A key difference is, CWT kernels are guaranteed to be zero-mean, STFT aren't, so STFT may leak in dc information which is undesired for bandpassing. Nice tutorial here; also see this answer.
If the quote doesn't refer to CWT and it's arbitrary bandpassing, I complement other answers in that STFT is a time-frequency representation, that enables powerful non-linear analysis methods via manipulating the joint 2D representation. E.g. synchrosqueezing for denoising or estimating instantaneous A.M. and F.M.
Using an STFT usually implies a set of FFTs or DFTs, each of which is identical to a bank of fixed length FIR filters (depending on any window(s) applied), that FIR filter length being the size of each STFT.
If you use a separate pre-filter, you can use an IIR or much longer FIR filter kernel, which may provide better filter characteristics (stop band attenuation, low frequency cut-off, Q factor, etc.) than can be accomplished within just the FFT length.
Both are basically convolution of a signal by one or several IIR or FIR filters (a bank of complex filters), that can be implemented in the Fourier domain. However, the "several filters" of the STFT are design together to possess certain "invertibility properties". They cannot be "any bunch of bandpass filters". For instance, they should (altogether) preserve the DC or zero-frequency component.
Short-Time Fourier transforms are inherently a signal representation (analysis only, onto a 2D time/frequency plan) that preserve all the original information content of the data. Filtering (linear ones) denotes operations that potentially modify the content of the data, by incorporating both analysis and synthesis back to the 1D initial time domain.
One advantage of the STFT is that it allows you to perform analysis, detection, masking, etc. in a nonlinear or non-time-invariant fashion by inserting processing blocks between analysis and synthesis, allowing to synthetize a result which is different from traditional filtering.