The range is determined by the party that builds the transaction. So anybody can specify it.
A range [t1, t2] —where t1 and t2 are integers, or infinite, standing for the slot number— can include any t2 that satisfies t2 >= t1. The only additional restriction is that transactions will be dropped if t1 lies too much in the future - I think the maximum is 2 days in the future. More explanations can be found in chapter 3.3.1 here: https://plutus-pioneer-program.readthedocs.io/en/latest/pioneer/week3.html
For the smart contract validator this means that the current slot is always in the range [t1, t2] (the blockchain will make sure that the transaction will not be processed outside this range) and that this range is potentially unbounded. If your smart contract needs a smaller range, this is however no problem, it just needs to be known and followed by the one building the transaction. Your off-chain code for instance would implement this and choose a proper range needed by your validator.