According to NEC, you should leave at least 6 inches of the wire. This value depends on one factor; the depth of the outlet box. Knowing how much wire to leave in an electrical box is crucial, as it can affect the box's safety and function. In this case, leaving the correct length of free conductor helps ensure proper installation and reduces the risk of loose or unsafe connections. Short wires might cause those wires to break. needing to re-strip the ends, getting a light fixture down to a comfortable working height, etc). I've installed a number of interior. Personally, I'd leave a bit more extra wire inside the box, if the volume allows, but not extra cable outside it.
[PDF Version]