Credits — the hearts at the top of your screen — are what let you keep playing Trivia. A wrong answer costs a heart, and when you're out of hearts that run ends.
They come back on their own. Once your credits are depleted, they refill automatically 30 minutes later. The header shows a countdown so you know exactly when you're back in, and you'll see a Your credits have been refilled! message when they return.
If you don't want to wait, you can top up immediately using the Refill button in the header. Credits are also handed out as level-up rewards as you climb the XP tiers.