A similar question is answered here: https://medicalsciences.stackexchange.com/a/17052/8728 but isn't really a duplicate.
This has been studied, not in the context of health to the individual with the beard, but the related issue of whether wearing a beard presents a danger to others in a health care setting.
Quoted from the earlier answer:
Wakeam, et al. found that clean-shaven men versus those with facial hair had different compositions of facial bacteria. Men with facial hair actually had less of some bacteria such as Staphylococcus aureus. The authors suggest that small cuts from shaving might actually promote colonization in some cases.
Overall, though, they conclude that there isn't really any increased risk from the facial bacterial milieu of those with facial hair (there are separate studies looking at issues with surgical masks, etc, but I feel it's a bit of a stretch to go into that here).
Lab techs with facial hair had numerically a few more bacterial species present than those without, but the differences aren't substantial and don't really represent any risk (Lindeholm and Arpi 2016) - importantly, coagulase-negative staphylococci were more common in the clean-shaven techs, which are normal skin bacteria but are also a risk for infection of open wounds.
Wakeam, E., Hernandez, R. A., Morales, D. R., Finlayson, S. R. G., Klompas, M., & Zinner, M. J. (2014). Bacterial ecology of hospital workers' facial hair: a cross-sectional study. Journal of Hospital Infection, 87(1), 63-67.
Lindeholm, Y. N., & Arpi, M. (2016). Facial hair–what about clinical microbiology technicians?. Journal of Hospital Infection, 93(3), 313-314.