The dynamic changes of the levels of volatile organic compounds (VOCs) produced by Bacillus subtilis CF-3 and their biocontrol effects on common fungal pathogens were researched in this study. The results showed that the VOCs in 24-h fermentation liquid (24hFL) of B. subtilis CF-3 inhibited mycelial growth of Botrytis cinerea, Colletotrichum gloeosporioides, Penicillium expansum, Monilinia fructicola, and Alternaria alternata, with a mean inhibition rate of 59.97%. The inhibitory effect on M. fructicola and C. gloeosporioides was the highest; they were therefore selected as target fungal pathogens for further experiments. Based on headspace solid-phase microextraction combined with gas chromatography-mass spectrometry (HS-SPME-GC-MS), 74 potential VOCs were identified during the fermentation: 15 alcohols, 18 ketones, 4 pyrazines, 4 esters, 10 acids, 5 phenols, 3 hydrocarbons, 3 amines, 2 aldehydes, 5 ethers, and 5 other components. At different fermentation times, the type and content of VOCs were different. Most of the potential VOCs (62 VOCs) were identified in the 48hFL. The inhibition rates of all VOCs reached their peaks (73.46% on M. fructicola and 63.63% on C. gloeosporioides) in the 24hFL. Among the identified VOCs, 2,4-di-tert-butylphenol, 1-octanol, and benzothiazole showed significant positive correlations with the rates of M. fructicola and C. gloeosporioides inhibition. Benzoic acid and benzaldehyde showed a significant positive correlation with the rates of M. fructicola inhibition, and anisole and 3-methylbutanal showed a significant positive correlation with the rates of C. gloeosporioides inhibition. In vitro, 2,4-di-tert-butylphenol showed a strong inhibitory effect on both M. fructicola and C. gloeosporioides. In vivo, benzothiazole showed the strongest inhibitory effect on the mycelial extensions of both M. fructicola and C. gloeosporioides, which also led to an increased rate of healthy fruit. The results of the present study clarified that 2,4-di-tert-butylthiophenol and benzothiazole are key inhibitory VOCs produced by B. subtilis CF-3.