The answer to 'what size junction box do I need' is that the size of the junction box you need depends on the number and size of the wires and devices that will be connected to it. As a general guideline, you'll want to choose a junction box that is large enough to accommodate all the wires and devices, with some extra space for making connections.
Most residential junction boxes come in standard sizes, such as 4x4 inches, 4x11/16 inches, or 4x1/2 inches. The size you choose will depend on the number of wires and devices, as well as the size of the wires. Larger junction boxes are typically used for larger gauge wires or when there are multiple circuits or devices being connected.