22 and
28 are the most popular answers to this question.
Wikipedia explains why there is a discrepancy. In short, it depends how you count them:
https://en.wikipedia.org/wiki/Human_skull
Bones
Various sources provide different numbers for the count of constituent bones of the human neuro- and viscerocranium. The reasons for such counting discrepancies are numerous. Different textbooks classify the bones of the human skull differently, e.g. they may (also) include (parts of) bones that are ordinarily considered neurocranial bones in their list of facial bones.
Some textbooks count paired bones (where there is one bone on each side) only once instead of twice. Some sources describe the maxilla's left and right parts as two bones. Likewise, the palatine bone is also sometimes described as two bones. The hyoid bone is usually not considered part of the skull, as it does not articulate with any other bones, but some sources include it. Some sources include the ossicles, three of which on each side are encased within the temporal bones, though these are also usually not considered part of the skull. Extra sutural bones may also variably be present, but they are not counted.
For all of these reasons,
it may not be easy or useful to reach agreement on an authoritative bone count for the neuro- and viscerocranium and the human skull. However, such discrepancies between various sources are only differences in how to classify and/or describe the anatomy of the human skull, and regardless of what classification/description is used, the basic anatomy remains the same.
With that in mind, as one possible classification, the human skull could for example be said to consist of twenty two bones: Eight bones of the neurocranium (occipital bone, 2 temporal bones, 2 parietal bones, sphenoid bone, ethmoid bone, frontal bone), and fourteen bones of the viscerocranium (vomer, 2 conchae, 2 nasal bones, 2 maxilla, mandible, 2 palatine bones, 2 zygomatic bones, 2 lacrimal bones)