The BCG must have a certain amount of gas to move it backwards to cycle properly. The biggest factor that affects the gas system is where the gas port is relative to the end of barrel. The gas can only enter the gas system from the time the bullet passes the gas port until the end of the barrel. The shorter that distance, the larger the gas port must be to let in the required amount of back pressure.
How long the barrel is will also play a part because of how far the gas must travel backward. A 24 inch barrel will need more gas to create the same back pressure than a 16 inch barrel with the same distance from port to end of barrel. Therefore, it will need a larger gas port. However with a 16 and 24 inch barrel with the gas port the same distance from the BCG, the 16 inch barrel will need a much larger gas port because the 24 inch barrel has much more time to push gas into the gas port.
I cannot calculate the port size like @98Z5V, but I hope this makes sense.