Aerodynamic theory predicts that dust grains in protoplanetary disks will drift radially inward on comparatively short timescales. In this context, it has long been known that the presence of a gap opened by a planet can significantly alter the dust dynamics. In this paper, we carry out a systematic study employing long-term numerical simulations aimed at characterizing the critical particle size for retention outside a gap as a function of particle size, as well as various key parameters defining the protoplanetary disk model. To this end, we perform multifluid hydrodynamical simulations in two dimensions, including different dust species, which we treat as pressureless fluids. We initialize the dust outside of the planet's orbit and study under which conditions dust grains are able to cross the gap carved by the planet. In agreement with previous work, we find that the permeability of the gap depends both on dust dynamical properties and the gas disk structure: while small dust follows the viscously accreting gas through the gap, dust grains approaching a critical size are progressively filtered out. Moreover, we introduce and compute a depletion factor that enables us to quantify the way in which higher viscosity, smaller planet mass, or a more massive disk can shift this critical size to larger values. Our results indicate that gap-opening planets may act to deplete the inner reaches of protoplanetary disks of large dust grains - potentially limiting the accretion of solids onto forming terrestrial planets.