When a player knocks, both sides count their deadwood, the cards left out of sets and runs, after the defender lays off what they can. Aces count one and face cards ten. The knocker scores the difference between the two counts.
Knock with no deadwood at all and that is gin: the opponent's whole deadwood plus twenty-five, with no laying off. If the defender's count is equal to or lower than the knocker's, that is an undercut, and the defender scores the difference plus twenty-five. In Cards Royale the first to one hundred wins, and your total is simply the sum of your hands.
At other tables
The classic rules on pagat.com pay twenty for gin and ten for an undercut, then add a hundred for winning the game (two hundred if the loser never scored) and twenty for every hand each player won. The rows under the sheet are there for that count. Source: pagat.com
This is how Cards Royale scores Gin Rummy. The full rules are on the how to play Gin Rummy page.