I assume you’re actually referring to the **discharge **pipe for the TPR valve? The code only addresses indoor installations.
CPC 608.5 Relief valves located inside a building shall be provided with a drain, not smaller than the relief valve outlet, of galvanized steel, hard-drawn copper piping and fittings, CPVC or listed relief valve drain tube with fittings that will not reduce the internal bore of the pipe or tubing (straight lengths as opposed to coils) and shall extend from the valve to the outside of the building, with the end of the pipe not more than two (2) feet (610 mm) nor less than six (6) inches (152 mm) above ground or the flood level of the area receiving the discharge and pointing downward. Such drains shall be permitted to terminate at other approved locations. Relief valve drains shall not terminate in a building’s crawl space. No part of such drain pipe shall be trapped or subject to freezing. The terminal end of the drain pipe shall not be threaded.