Context. The mass of protoplanetary disks is arguably one of their most important quantities shaping their evolution toward planetary systems, but it remains a challenge to determine this quantity. Using the high spatial resolution now available on telescopes such as the Atacama Large Millimeter/submillimeter Array (ALMA), recent studies derived a relation between the disk surface density and the location of the “dust lines”. This is a new concept in the field, linking the disk size at different continuum wavelengths with the radial distribution of grain populations of different sizes. Aims. We aim to use a dust evolution model to test the dependence of the dust line location on disk gas mass. In particular, we are interested in the reliability of the method for disks showing radial substructures, as recent high-resolution observations revealed. Methods. We performed dust evolution calculations, which included perturbations to the gas surface density with different amplitudes at different radii, to investigate their effect on the global drift timescale of dust grains. These models were then used to calibrate the relation between the dust grain drift timescale and the disk gas mass. We investigated under which condition the dust line location is a good mass estimator and tested how different stellar and disk properties (disk mass, stellar mass, disk age, and dust-to-gas ratio) affect the dust line properties. Finally, we show the applicability of this method to disks such as TW Hya and AS 209 that have been observed at high angular resolution with ALMA and show pronounced disk structures. Results. Our models without pressure bumps confirm a strong dependence of the dust line location on the disk gas mass and its applicability as a reliable mass estimator. The other disk properties do not significantly affect the dust line location, except for the age of the system, which is the major source of uncertainty for this mass estimator. A population of synthetic disks was used to calibrate an analytic relation between the dust line location and the disk mass for smooth disks, finding that previous mass estimates based on dust lines overestimate disk masses by about one order of magnitude. Radial pressure bumps can alter the location of the dust line by up to ~10 au, while its location is mainly determined by the disk mass. Therefore, an accurate mass estimation requires a proper evaluation of the effect of bumps. However, when radial substructures act as traps for dust grains, the relation between the dust line location and disk mass becomes weaker, and other mass estimators need to be adopted. Conclusions. Our models show that the determination of the dust line location is a promising approach to the mass estimate of protoplanetay disks, but the exact relation between the dust line location and disk mass depends on the structure of the particular disk. We calibrated the relation for disks without evidence of radial structures, while for more complex structures we ran a simple dust evolution model. However, this method fails when there is evidence of strong dust traps. It is possible to reveal when dust evolution is dominated by traps, providing the necessary information for when the method should be applied with caution.