If you enter decompression without prior planning, you have broken your no decompression limit (NDL). If this were to happen, you would be required to make decompression stops on your way back to the surface to avoid decompression-related injuries. The best way to avoid this is to plan conservatively, watch your time and depth, and use a dive computer, which will give you safe dive times and warnings if you are near your limits.
You may also run low on breathing gas while you are performing the required stops. Some dive boats will have a spare cylinder and regulator, commonly referred to as a “hang cylinder,” hanging over the side of the boat to provide extra gas for this situation.