There are several different types of shut off valves. Generally speaking in order to shut off the gas you will need to rotate the handle 90 degrees. The handle should be at a 90 degree angle from the fitting or pipe when the valve is OFF/Closed. When the handle is in line with the pipe it is fully open. (as shown in the image I added)
I added an image below showing the gas valve in the ON position, rotate the handle 90 degrees to shut the gas OFF. If it will not turn one direction, turn it the other direction.