Sample size is the number of units needed in each group to reach the desired power. It is calculated before the test from the baseline level of the metric, the minimum detectable effect, the alpha threshold, and the power. Stopping the test before reaching this size distorts the conclusions.
Example
from statsmodels.stats.power import NormalIndPower
NormalIndPower().solve_power(effect_size=0.1, alpha=0.05, power=0.8)