If you drive a manual transmission vehicle, you always shift into neutral when you are waiting for a light or at a stop sign. But if you have an automatic transmission you probably leave it in gear. Remember that the transmission's job is to let the engine run in a narrow range of speeds (where it is most powerful or efficient) while using different gear ratios to provide a wide range of vehicle speeds. But how does this allow you to stop your car while the engine is running? The engine is still turning over but the output speed is zero. This would mean that the transmission would have to provide a gear ratio of zero. In fact it does not.
The torque converter is what allows a vehicle with automatic transmission to stop in gear while the engine is still turning over. In a manual transmission, the clutch directly connects the flywheel to the input of the transmission and so both have to stop together. Torque converters use a fluid coupling system to connect the engine's flywheel and the input of the transmission. With a torque converter there is no direct mechanical contact. Because fluid is used to make the connection, the flywheel can be turning while the output of the torque converter remains stationary. When you are stopped at a light in gear, the engine is turning over but the torque converter passes only a very small torque on. This small torque can be easily resisted by the brakes.
Using your brakes while stopped in gear thus puts extra load on your engine. This extra load will result in using more gas. If you have an automatic transmission shift to neutral when you are stopped. Not only will it reduce engine load a little and save you some gas, but it will give your torque converter a chance to cool down.