Magic Gems are for use in the dungeon Demon Party, which can be found on the top of the Dungeons tab under the "EVENT" button (located to the left of the minimap). This dungeon is offered in both Solo or Multi modes, each uses this item the same. Magic Gems are for one time use only, after completing one succession of Demon Party the same gems cannot be used for the next--They will be expired and new Magic Gems will have to be both earned and used. Your extra Magic Gems should disappear but sometimes they do not, either way they will not be able to be used.
Once in the dungeon their use will be obvious by a toolbar that automatically appears, a shop that uses both StarCoins and Magic Gems. This shop can be upgraded by use of scrolls of which are gained by defeating a boss. By upgrading will allow more use of these gems.