It depends. Consider these examples.
Suppose during an elementary calculus exam you a question asking you to prove that a given real polynomial of degree three has a root. A standard solution would be to use the intermediate value property. You could also use the fact that any real polynomial of odd degree has a root, and technically that would be a proof, but that would clearly not be a good solution -- the proof of that general fact is just a more abstract instance of the proof for a given polynomial of degree three. In fact, you could even use the general fact that every polynomial of degree three has a root. I hope you can see how that would be very far from being a solution.
For another example, suppose you had a class in elementary number theory, and you were asked to show that some diophantine equation has no solutions, but somehow you could reduce the equation to an instance of the Fermat's Last Theorem. Technically, you could just do the reduction and apply the theorem, but would that really be a good solution?
You could even think of a more extreme example: suppose you were asked to prove a given theorem during an exam (regardless of whether or not it was taught during the class in question). Would simply invoking the theorem and saying that the proof is completed be a good solution?
For a more subtle example, suppose you were to find the limit of sine of x over x at zero. You could try applying L'Hospital rule. This is not such an advanced theorem, but using it would still be wrong (as you need to know the derivative of sine to apply it, making the reasoning entirely circular).
The point is, at least during the introductory courses, you are mainly supposed to show how well you understand and apply basic concepts. Frequently, there may be an advanced theorem which would allow you to largely or completely avoid really using these elementary concepts, and you don't show that you understand them well. Moreover, this can allow you to do (possibly veiled) circular arguments.
On the other hand, if you use some more advanced concepts to circumvent a technical problem (or just to make a more beautiful proof), while still showing that you understand the underlying elementary ideas very well, you should not (in my opinion) be penalized. Similarly, if you use advanced ideas, but prove every step "from the ground up", I would say that penalizing you would be very wrong.
During more advanced courses as well as final exams, you are expected to have more broad knowledge and are much less likely to be penalized for using even somewhat advanced concepts. However, the same basic rules apply -- using the Fermat's Last Theorem would not be OK in my opinion, not even during an intermediate graduate number theory exam (unless explicitly allowed). It's mostly a matter of common sense.