I don't think there is a unique definition of this, but a common way to consider it would be to look at the electron density in the direction perpendicular to the interface. If there is a clear separation of charge, such as positive on the left and negative on the right, you could pick some distance from the interface and integrate all net charge on each respective side. Again, as with many such quantities, just computing it for a single system has limited value, but comparing the results for different cases (added dopants, applied bias, temperature) can yield useful insights.