Are service loops allowed by US electrical code in residential wiring?
If the box has clamps 12" to the staple is allowed if the box doesn't have clamps only 8" is allowed to the staple. I usually try to provide a bit of slack because after years of service, outlet changes because of being worn out, color change or style change the wires become two short if there is a an extra inch or two this saves $ over the life of the home and cost almost nothing.