Once the gas limit has been reached, the miner will stop working on it. So, if your gas limit was more than needed, the funds would be returned to the operation generator. If the gas limit was too low, the operation will be canceled and the miner will keep a fee for their work .