There are a lot of puzzle games, and even more of the matching gem style puzzle games. While Candy Crush seems to be the most well known game in the genre, I think the very first one that I ever played was Bejeweled.
For the most part they’re pretty much the same thing. You match up gems of the same colour of three or more and they vanish. You then collect points and more gems fall to fill in the void. If the falling gems make more matches then you get a combo, more points, and so on. The goal for these games are mostly high score.
Later on games started adding in other elements to these games such as RPG battles to extend the life of the games. No longer was the matching of the gems merely the goal of the game but a means to an end. The gems could be used to gain points which could be used to power fighters or other things. I reviewed a mobile game a while back called Spirit Stones that did this well, as did Puzzle and Dragons Z + Super Mario Edition for the Nintendo 3DS.