We present a comprehensive statistical study of magnetic holes, defined as localized decreases of the magnetic field strength of at least 50%, in the solar wind near Mercury, using MESSENGER orbital data. We investigate the distributions of several properties of the magnetic holes, such as scale size, depth, and associated magnetic field rotation. We show that the distributions are very similar for linear magnetic holes (with a magnetic field rotation across the magnetic holes of less than 25°) and rotational holes (rotations >25°), except for magnetic holes with very large rotations (≳140°). Solar wind magnetic hole scale sizes follow a log-normal distribution, which we discuss in terms of multiplicative growth. We also investigate the background magnetic field strength of the solar wind surrounding the magnetic holes, and conclude that it is lower than the average solar wind magnetic field strength. This is consistent with finding solar wind magnetic holes in high-β regions, as expected if magnetic holes have a connection to magnetic mirror mode structures. We also present, for the first time, comprehensive statistics of isolated magnetic holes in a planetary magnetosheath. The properties of the magnetosheath magnetic holes are very similar to the solar wind counterparts, and we argue that the most likely interpretation is that the magnetosheath magnetic holes have a solar wind origin, rather than being generated locally in the magnetosheath.