When I wire new construction, I will leave about 8-12" of wire outside the box. This ensures that when the drywaller comes along and uses his roto-zip with the blade all the way out and cuts our wires inside the box, we still have wire to rectify this.
Depending on the item being wired, sometimes we will leave more than 12", but this gets complicated quickly because the cable needs to be stapled within 12" of the box, measured along the cable.
Sent from my new phone. Autocorrect may have changed stuff.