Terrestrial gamma ray flashes (TGFs) are short bursts of gamma rays occurring during thunderstorms. They are believed to be produced by relativistic runaway electron avalanches (RREAs). It is usually admitted that the number of high-energy electrons produced in the brightest TGFs remains mostly confined within a range from 1017 to 1019. To understand the constraints in the development of RREAs, we perform self-consistent simulations using a newly developed model with a finite acceleration region and various injection rates. We find that RREAs should naturally self-quench for a fixed total number of runaway electrons, and hence a fixed number of bremsstrahlung photons. From the idea that TGF sources quench themselves, we derive a simple equation controlling the total number of runaway electrons. In this framework, the existence of a saturation in the electron density discovered in a previous work places a lower limit on TGF durations. Terrestrial gamma ray flashes (TGFs) are short bursts of high-energy photons occurring during thunderstorms. They are believed to be produced by energetic electrons accelerating due to the intense electric field, forming a Relativistic Runaway Electron Avalanche (RREA). Discovered fairly recently, many of the TGF features remain unexplained. In this article, we aim to understand the constraint on the number of high-energy electrons produced during TGFs, that always remains confined between 1017 and 1019. Using a newly developed simulation model, we find that RREAs naturally quench themselves when the number of high-energy electrons and photons reach the range previously mentioned. Based on a limited number of fundamental processes, we were able to derive a simple equation controlling the total number of runaway electrons and deduce a lower limit for TGF durations. There is a maximum low-energy electron density reachable in Terrestrial Gamma Ray Flashe (TGF) sources when relativistic runaway electron avalanches (RREAs) reach saturation: nesat similar to 1015 ${n}_{e}<^>{\mathit{sat}}\sim 1{0}<^>{15}$ m-3 There exists a minimum TGF timescale equal to the RREA timescale: tau min similar to 1 mu s The self-quenching of the TGF sources implies a maximum number of electrons Ne similar to 1017