Really depends on the types of of connectors, quantity, if it's flush or surface mount, how deep the wall is, and how many cables need to be cable managed behind the panel
The minimum size I use is 4" square with a 1- or 2-gang ring. Minimum depth 3-1/2". Except for extraneous
XLR connectors I don't allow typical masonry-type gang boxes.
Most back boxes I spec are 4" deep. Some are 6" if I need to fit a transmitter or a CAT6/CAT6A
connector that doesn't have a 90° termination option to it or I have
coax cable in that box. I'll go as deep as 8" sometimes if I need something with a
MASS connector on it so there's room enough for
strain relief and
service loop behind the panel.
I use a lot of 6" square boxes with 1-, 2-, or 3-gang rings, which gives room for cable
bend radius and
service loop.
When it comes to
speaker connections, I spec the NL4
panel mount connectors with
flat tabs so all connections are crimped rather than soldered or screwed. This doesn't usually affect
back box depth but it makes the terminations easier and less prone to error. Also makes it easy to fix when the new guy flips
polarity all over the place.
If you try to use something non-standard like a 14" x 14"
back box, your electricians will
beat you up and tell you they don't make a box like that. They do, actually, but it's special order and not widely available.
Also have to account for
spacing between connectors both for rear-access terminating, and for front-access visibility of labels and room for getting your fingers in to press the latches and twist.
Along the top/bottom/sides, best to to have the electricians pipe into the rear of the box rather than along the front. If they pipe in near the front or the box is too shallow, your connectors will crunch down on your cables where they enter the box via
conduit.