What is the maximum distance allowed between the gas shut off and the appliance it serves?

What is the maximum distance allowed between the gas shut off and the appliance it serves?