In piping we all know we have two basic situations; one is Fitting-to-Fitting and the other is not Fitting-to-Fitting.
With the first, there is nothing between one fitting and another except the weld. Therefore we call it "Fitting-to-Fitting or "Fitting make-up"
With the second, the required overall dimension does not allow for Fitting-to-Fitting configuration. We then have an ELL, gap, ELL or ELL, gap, Reducer, ELL or ELL, gap, Flange or ELL, gap, reducer, flange or some combination of standard fittings BUT not Fitting-to-Fitting. There is that short gap between two of the fittings. This is an all too common natural occurrence in piping design.
This short gap is where a piece of pipe must be placed (cut, beveled, fitted and welded) to connect the two fittings that don't touch. The short piece of pipe is called a "Pup" piece. The piece of pipe or "Pup" can be pretty much any length however when it gets to be around a foot in length it is no longer called a "Pup". A long piece of pipe is just a piece of pipe. The really short ones are called a "Pup".
The only restriction for the length pf a "Pup" piece is common sense or a company imposed minimum length. This minimum length is defined in different ways by a Lead Design Supervisor or company and there is no absolute Code restriction or commonality. Individual pipers or a company minimum may consider the pipe wall thickness, the weld bevel, the heat effected zone, or the real or perceived ability of the shop to make a weld. There is no magic rule and there is no common industry standard.
In referring to the proximity of butt welds in pipe, the piping Codes do not provide specific guidance. In this situation, you must use engineering judgment such as, locate the butt welds as far apart as possible to avoid overlapping weld "heat affected zones" and stress concentration effects. For girth weld spacing, a criterion that has been used for many years is: the greater of 2 inches or 4 times the wall thickness.
You might also want to talk to a good Welding Engineer as it could be dependent on the actual welding process. If this is for proximity of weld joints to one another there could be other concerns. Again the Welding Engineer could help you. There is no maximum length at all. There is a generally recognized minimum length is : smaller 1xOD or 500mm, between Fittings welds, but this is a workmanship limit and not defined in ASME B31.3 or any other codes or standard as far as I know.
(Just for interest's sake, Australian Standard AS 4458 specifies the following: "The distance between the edge of two circumferential butt welds shall not be less than four times the pipe wall thickness or 30 mm, whichever is the greater, unless the first weld is post weld heat treated (PWHT) before the second weld.")