We present a detailed study of the Orion B clouds (d~400 pc), imaged with the PACS/SPIRE cameras at 70-500 $mu$m by the Herschel Gould Belt survey (HGBS). We release new high-res. maps of column density and dust temperature. In the filamentary sub-regions NGC2023/2024, NGC2068/2071, and L1622, 1768 starless dense cores were identified, ~28-45% of which are self-gravitating prestellar cores. A total of 76 protostellar dense cores were also found. The typical lifetime of the prestellar cores was found to be $t_{rm pre}=1.7_{-0.6}^{+0.8}$ Myr. The prestellar core mass function (CMF) peaks at ~0.5 $M_odot$ and is consistent with a power law with log slope -1.27$pm$0.24 at the high-mass end, compared to the Salpeter slope of -1.35. In this region, we confirm the existence of a transition in prestellar core formation efficiency (CFE) around a fiducial value A_V_bg~7 mag in background visual extinction, similar to the trend observed with Herschel in other clouds. This is not a sharp threshold, but a smooth transition between a regime with very low prestellar CFE at A_V_bg<5 and a regime with higher, roughly constant CFE at A_V_bg$gtrsim$10. The total mass in the form of prestellar cores represents only ~20% of the dense molecular cloud gas at A_V_bg$gtrsim$7 mag. About 60-80% of the prestellar cores are closely associated with filaments, and this fraction increases up to >90% when a more complete sample of filamentary structures is considered. Interestingly, the median separation between nearest core neighbors corresponds to the typical inner filament width of ~0.1 pc commonly observed in nearby molecular clouds. Analysis of the CMF observed as a function of background cloud column density shows that the most massive prestellar cores are spatially segregated in the highest column density areas, and suggests that both higher- and lower-mass prestellar cores may form in denser filaments.