Certainly the cable should be long enough to be under full compression by the tightening screw.
The extended length beyond that I have found is a trade-space between design and preference. Some derailleurs and brakes have nice little routing features that allow you to tuck the extra behind a controlled point preventing annoying rubbing on your legs or tires.... If there is too little extra you may not be able to utilize this feature. Some components don't have the routing feature, In that case I usually provide anywhere between 2 to 3 inches. I have found that length is best for tucking out of the way.. and if in the rare case I need to pull some slack our of the cable I have enough to get a good purchase without the use of pliers.
If adjusted correctly the first time.. it is rare that you will need to let out cabling at the point of contact with the brake or derailleur but keep in mind that rare does not mean never so if you think its too short it probably is worth getting a new cable.