How do the Infinity Gems work?
The Infinity Gems, originally referred to as Soul Gems, are six immensely powerful fictional gems appearing in American comic books published by Marvel Comics. Whoever holds all six gems and uses them in concert, such as in the Infinity Gauntlet, gains virtual omnipotence and omniscience. In later story lines and crossovers, a seventh Infinity Gem is sometimes added to the primary six.
From: Thanos Quest #2