Does the NEC limit the maximum size of junction boxes?
There is no limit on SIZE - I've worked (in non-residential settings) with some you could sit in.

The practical concern with the "box and 4 extensions" shown is that the wires up at the ceiling are supposed to be able to come 6" out of the open face of the box, IIRC. From a practical working point of view it's usually better to put in a large box you can work in rather than a bunch of small extension boxes, but mostly code wants adequate volume, and adequate wire length, and does not mind a bit if you have more volume, or have made it awkward as shown.

Personally, if I need more room than an extension on a 4 or 4-11/16's box gets me I'm going to throw in a 6x6x4 or an 8x8x4 rather than construct a cluster-bleep like that. But I'll use a 4 inch and one extension quite happily, especially when it's way cheaper than a single bigger box (though I am always slightly befuddled that the extension costs more than the box does.)

Both orange and blue borgs (not a particularly good source of electrical supplies beyond the very run of the mill) stock up to 10x10x4 (400 cubic inches) at my local stores. Real electrical suppliers can get much bigger ones, but your wallet will prevent you from going there unless you actually need to.

Of course, most houses have at least one fairly large junction box, the center of which is full of circuit breakers ;-)