From my understanding the only factor is time. In the past I would faithfully use the voyage estimator found in this thread to get an estimate of how much dilithium it would cost me for extensions
A player can run out of antimatter only because of normal activity (one AM per action) or of hazards (30 AM per failure). When reaching 0 AM, the ship is stranded in space: the player has the choice of aborting the mission (sacrificing all the rewards) or refilling the AM by spending dilithium. The amount of dilithium needed to restore the antimatter depends on how long the voyage has lasted thus far with the equation:
Comments
https://forum.disruptorbeam.com/stt/discussion/175/tool-voyage-estimator-help-us-gather-data/p1
And you can go to the voyage estimator directly from this link as well
https://codepen.io/somnivore/full/Nabyzw
"Running out of Antimatter:
A player can run out of antimatter only because of normal activity (one AM per action) or of hazards (30 AM per failure). When reaching 0 AM, the ship is stranded in space: the player has the choice of aborting the mission (sacrificing all the rewards) or refilling the AM by spending dilithium. The amount of dilithium needed to restore the antimatter depends on how long the voyage has lasted thus far with the equation:
Time (Min.)/5 = Dilithium."