It depends if you're running a new run from the main box or tapping off an existing circuit at some kind of junction. If it's the second, you are limited by the existing condition. If it's a 15 amp circuit (on breaker at main box), use only #14. If it's a 20 amp circuit, use #12. That's all after you've determined existing load on the line.
If the circuit being tapped has low usage items (ie not a refrigerator) that will not be in use when using your barn, should not be a problem. That means power equipment etc. 20 amp or higher would be better than a 15 amp so use #12 wire and 20 amp breaker or better if tapping off main box.