I highly suggest that you watch <PERSON> lecture exactly on that topic given at BYU. Someone also linked his blog if you want to read further. I'll try to summarize it from memory. It's basically 3 + 0 rules:
1. The more the reader understands your magic system, the more you can use it for satisfying problem solving:
This is basically proper foreshadowing. If you left it ambiguous and use it to resolve the main conflict, it's just Deus ex machina. If you explain the boundaries well beforehand and have the characters use it as a tool in different situations, every instance looks canny. Even more so for important plot points.
That is not to say you should always explain your magic in depth. For example, you can have a shiny new wizard save the protagonist from trouble early in your story. What it does is introduce a character, establish him as a badass and expand what is possible in the universe.
In short:
+ Scarcely explained magic can be used to create a sense of wonder and excitement.
+ Thoroughly explained magic can be used to solve problems in a way that the reader will perceive as clever/well thought out.
2. 805
Flaws and limitations are more interesting than powers:
A tool that can solve every problem negates any conflict. Stories revolve around obstacles that are hard to overcome.
Also it's easier to make your magic mechanics look unique by placing some limitations on them, rather than think of completely new powers no one has used before. Mind control is generic and overdone. Mind control that can only be performed by the priests of a given god on followers of that faith that broke their oath can be interesting and reality immersing. Additionally, consider adding some sort of cost to your magic in addition to hard boundaries.
3. Go deeper, not wider:
Your tale is not a wizard's text book. There is a limit beyond which it becomes an info dump of ideas in your head, rather than a story. And as per the first rule, you better explore the sorcery you will resolve conflicts with deep enough.
In addition, it reduces the possibility for accidental plot holes.
4. Make it awesome:
Pretty self explanatory. If you are writing an epic fantasy series, it helps if the protagonist's power isn't to be invisible when no one is looking. Though you can totally go that route if you are writing a comedy. 805