What is Gas Limit?
Gas limit is the maximum amount of gas a user is willing to spend on a transaction — setting an upper bound on computational work to prevent runaway execution and protect against infinite loops.
WHY IT MATTERS
The gas limit serves as a safety valve. Complex contract interactions can consume unpredictable amounts of gas. By setting a limit, you ensure your transaction won't spend more than intended — if execution exceeds the limit, the transaction reverts.
Two levels of gas limit exist: per-transaction (set by the sender) and per-block (set by the protocol, currently ~30M gas on Ethereum). The block gas limit caps the total computation in each block.
Setting gas limits correctly matters: too low and your transaction reverts (but you still pay for gas consumed). Too high and you risk overpaying if gas estimation is wrong. Modern wallets estimate gas automatically.