Gin Rummy is the great two-player card game: you're dealt ten cards and you're trying to arrange them into melds — sets of the same rank, or runs of the same suit — while shedding the cards that don't fit, which are called deadwood.
You don't have to complete everything. Once your deadwood is ten points or fewer you can 'knock' and end the hand, scoring the difference between your deadwood and your opponent's. Getting it to zero is 'going gin' and scores a bonus. Knowing when to knock rather than push for gin is the whole game.
Any card in your hand not part of a set or run. Each counts its face value (face cards are 10), and the total is what determines whether you can knock and how much you score.
When your deadwood totals 10 points or fewer. You score the difference between your deadwood and your opponent's — but if theirs is lower, they score instead, which is called an undercut.
Melding all ten cards with zero deadwood. It scores a bonus and can't be undercut, but chasing it too long often means being beaten to the knock.