A metric is a generalization of distance, capturing some of the characteristics of distance. It is a function of pairs of points in a space to a non-negative number, such that the metric from a point to itself is zero, that applying it to the reverse (i.e., B to A instead of A to B) yields the same result, and that the metric from A to C is always less than or equal to the metric from A to B plus that of B to C, all statements that would hold true of ordinary distance.
In physics, metrics of non-straight lines are of interest, e.g., specifying "the metric of A to C through B", and for curved lines in continuous spaces, using a line integral.
A variation on the metric concept is relevant to space-time in relativity, i.e., a metric, but allowing a zero metric in some cases where points are distinct. Examples are the Minkowski metric used for special relativity (relativistically invariant, i.e., invariant under the Lorentz transformation), the Schwarzschild metric for general relativity given the influence of a mass, and the Robertson-Walker metric incorporating GR and the expansion/contraction of a model universe.