Cage length doesn't directly dictate overall gear range, but under some safety constraints can dictate the overall gear range.
First, instead of "cage length", it's best to talk about "derailleur capacity", which correlates to cage length, but also includes factors such as placement of the derailleur relative to the rear axle and the size of the pulley wheels.
To see why, we can start with a 1x (single chain ring) system. In this case, the derailleur capacity tells us how how different the largest and smallest cogs on the cassette can be.
If we go to a 2x or 3x system, the capacity tells us the maximum range in (chainring teeth + cog teeth) we can access without making the chain too tight or too loose.
For a given cassette, the capacity thus determines the maximum difference between the chainring sizes that can be accommodated, and thus the maximum gear range if the system is required to function in all gear combinations.
If the rider can be trusted not to cross-chain the system into a big-big or small-small configuration, however, the range can be expanded so that capacity dictates the difference between [smallest chainring + smallest cog allowed with that chainring] and [largest chainring plus largest cog allowed in that chainring].