Gems are the virtual currency for all iOS and Android mobile users. Web users will see Lingots, also a virtual currency.
You will earn Gems or Lingots for completing lessons on Duolingo. Typically you will earn Gems or Lingots when you meet your daily XP goal.
You can use this virtual currency for purchases in the app/web shop. To access the store, tap the Shop tab. If you're a web user, you can click here. You will see your total number of Gems/Lingots displayed in the shop. You can use your Gems for a variety of app features, such as a streak freeze, heart refill, and streak wagers.