Not specific to STM32F chips but generally the datasheet specififies the valid frequency range - your crystal would have to fit into that range.
From there, I usually pick the lowest frequency that with the PLL can hit the highest operating frequency. Say your chip can run at 72Mhz max. With a PLL multiplier from 2x - 16x. I would pick 8Mhz crystal (8Mhz x 9 = 72Mhz). This approach allows the widest range of possible frequencies.
After that, you may need to refine it, for example if you are running a uart; or if you require a particular master clock out frequency, etc. Or due to sourcing: 4/8/16/24Mhz crystals are the most common ones. Or if you are running USB.