Every gas appliance has a rating for how much gas it burns at full power. The pipe has to carry that rating over the distance from the supply, and a long run, a second appliance on the same branch or a tankless heater can turn a line that looked fine into one that starves the burner. We add up the load before we choose the pipe.
Depending on where the line runs we use steel pipe, flexible stainless tubing or buried polyethylene, with supports, sleeves and protection where the pipe passes through walls or ground. The photo shows a tankless unit with its flexible connector and shutoff within reach, the way every appliance line should finish.