Magic is bought at stores, but in order to access higher level spells, a person must acquire the gift for them. Then through usage of various spells of a type, you will learn the higher level spells. You can also learn the lower level spells if you haven't bought them. The only exceptions to the gift are realm, mystic, time and space. Only Blue and Rouge have the gift for Realm magic, while Mystics, and half-Mystics, are the only ones with the gift for Mystic magic. Time Lord and Kylin are the only ones with the gift for time and space magic respectively. Blue is able to get the gift for one of them by defeating one or the either during his quest.
If you want to buy magic from an opposing group (like light and shadow) you will be forced to give up the magic and gift for its opposite. Be careful though, since you can only get the gift once, and once you give it up you can't get it again.
Magic consumes JP (Jutsu points) in order to be cast.
The highlighted portions on the following magic pages are the higher level spells that require the Gift to learn.