The term gamification first appeared in the business context, where the elements of game mechanics were used in order to improve the results of corporate trainings, especially in marketing and sales. In recent years such approach is gradually adopted also in education. However, as it is the case with personalization also gamification is understood in many different ways, not always correctly.
First of all the gamification must be distinguished from using games in teaching and learning. The former is called Game Based Learning (GBL) and the games that are used can either be produced with educational purpose (educational games, serious games) or just for entertainment but are applied for learning and teaching (like Minecraft or World of Warcraft, just to mention the most popular ones). Gamifications refers to applying the elements of game mechanics in non-game context. It is most commonly understood as using levels, marks and badges which are expected to motivate the learners and to illustrate their achievements. However, the gamification gurus (like A.Marczewski or Jane McGonigal) frequently object against such simplification and indicate the basic features that constitute the game. At least four key elements should be listed as the game traits: a goal (sometimes also called a challenge), rules, a feedback system and voluntary participation.
Jane McGonigal in her book Reality is broken, why games make us better and how they can change the world (Vintage Books, London 2012, p.21) gives the following explanation of those traits:
“The goal is the specific outcome that players will work to achieve. It focuses their attention and continually orients their participation throughout the game. The goal provides players with sense of purpose.
The rules place limitations on how players can achieve the goal. By removing or limiting the obvious ways of getting to the goal, the rules push players to explore previously uncharted possibility spaces. They unleash creativity and foster strategic thinking.
The feedback system tells players how close they are to achieving the goal. It can take the form of points, levels, a score, or a progress bar.
Finally, voluntary participation requires that everyone who is playing the game knowingly and willingly accepts the goal, the rules, and the feedback. Knowingness establishes common ground for multiple people to play together. And the freedom to enter or leave a game at will ensures that intentionally stressful and challenging work is experienced safe and pleasurable activity.”
All those traits are indispensable when we think about using the game mechanics in teaching and learning.

Some resources on that topic are indicated in We recommend section.