I don't know if these lengths are "optimum" but they have worked for one or two rocket designs...
The coupler for Estes BT-60 (which has a 1.6 inch O.D.) is 1.5 inches long
The coupler for Estes BT-50 (which has an O.D. just under 1 inch) is 1.0 inches long
The coupler for Estes BT-20 (O.D. just under 3/4 inch) is 3/4 inches long
The pattern I see here is coupler length = approx 1 diam
In most cases that I can remember, the instructions prepared by Estes recommend gluing half of the coupler on each side of the joint. That seems to work OK.
I am not sure that the length of a NC shoulder is so clear-cut. I have seen lengths equal to anywhere from half to one full diam. This is also going to depend on how much bending moment there is on the joint, how strong the local BT is (can you reinforce with a fiberglass wrap, or by soaking the BT with CA?), and how strong/stiff the shoulder materials are (can you reinforce the shoulder by soaking with CA?). Rockets with a long payload section might need a stronger shoulder at the base than simpler rockets with only a plain NC. And the longer the shoulder, the heavier the rocket; you get less speed, less altitude, more stability.