I wouldn't say there is a straight up quantitative (numeric) indicator for when to use median over mean; rather I think it's a function of what you're trying to do. If all you want to do is describe the data, then you should visualize it and determine if there is heavy skew or extreme outliers (both of which affect the mean but not so much the median). If there is, use median and measures of position to describe the data. For instance, US household income (which is highly right-skewed and contains extreme outliers like professional athletes and Jeff Bezos) is often described using median for this reason.
If instead you want to do tests on the data, you may want to use both approaches, check your assumptions and compare results. Parametric tests (where the distribution is assumed to be normal or can be made normal under the Central Limit Theorem) are often very robust, but there are instances when non-parametric tests (which make no assumptions about the underlying distribution) would be preferred. There's no black-and-white answer here, but rather relies on your justification for using the approach you did.