"Who's got the sword, motherfucker?"
Gollum wants three guesses, and Bilbo agrees. Gollum's first guess is "handses." Bilbo, having taken his hand out just in time, says, "Wrong." Gollum starts to freak out, and verbally runs through a list of things that he thinks somebody would keep in their pocket: "Fish-bones, goblins'-teeth, wet shells, bat-wing..." before settling on "knife." He tells himself to shut up, and when Bilbo tells him he's down to his last guess, each of Gollum's personalities offers an answer: "String! Or nothing!" Bilbo chides Gollum for using two guesses at once, and tells him that both are wrong. Defeated, Gollum collapses in tears.
The Book: Gollum gets out of the boat and sits down next to Bilbo Baggins. He starts pawing and poking the hobbit, badgering him to ask a final question. Bilbo is unable to think of a riddle; he pinches himself, slaps himself, grips his sword, and feels around in his pocket. Only then does he remember the object he had absent-mindedly put there earlier. He says "What have I got in my pocket?", but not to Gollum - he's just wondering aloud to himself. Gollum interprets it as a riddle however, and argues that it wasn't a fair question. Bilbo decides to stick with his question, so repeats the question a little louder. Gollum demands three guesses, which Bilbo grants. He first guesses "handses," and Bilbo, who had "luckily just taken his hand out," says he's wrong. Gollum mentally makes a list of things he keeps in his pockets - fish-bones, goblins-teeth, wet shells, a bit of bat wings, a sharp stone to sharpen his fangs on - before settling on a knife. He's wrong again, so he takes his time coming up with a third answer. He hisses and sputters until Bilbo tells him that his time is up, so Gollum shrieks "String, or nothing!", trying to work two answers in at once. They're both wrong, and Bilbo is relieved. He knows that a riddle game is a sacred thing of immense antiquity, that even "wicked creatures were afraid to cheat." He muses that his last question was not a genuine riddle according to "the ancient laws," and he fears that Gollum will react poorly to being cheated. Instead, however, Gollum says that he will help Bilbo find a way out, but first, he needs to go get something.
What difference does it make? In terms of plot, or narrative, the minor changes here make no difference at all. The only real changes are Bilbo's musing over the ring, the book's mention of the riddle game as a thing of sacred antiquity, and Gollum's reaction to losing (which I'll cover in a bit). The differences hardly matter, however; like the rest of the riddle game, the book and movie are almost word-by-word the same.
My Opinion: I think this scene is really, really good. The only changes that were made are those that are necessary to making a successful movie adaptation. It remained as faithful to the book as possible, even managing to squeeze in a few more references, like Gollum's list of things that go in pockets. I'm not sure this scene could have gone better. However, I'm still a little disappointed in it. It's hard to exactly explain why, but, here goes:
There's a facet of Bilbo Baggins' character in this scene, in the book, that the movie fails to convey. In the book, he doesn't know what's in his pocket; his musing "what have I got in my pocket?" is a total non-sequitur that he decides to run with on a whim. His gambit succeeds, but Bilbo then worries that Gollum will grow upset that he was cheated; the sacred riddle game is something that even wicked creatures play fairly. But Bilbo Baggins, an upstanding citizen of the Shire, cheated. This shows some quick thinking and guile that I really appreciated in the little hobbit. It's not what you'd expect from him. This scene, for the first time, is his time to shine.
The movie doesn't exactly get the character wrong, here. Not at all. Bilbo still shines, and is still a witty, intelligent hero in this scene. But he already knew what was in his pocket, and there's no mention of the riddle game having any sort of inviolable laws that he just broke. The movie version is still great, but there's some depth to Bilbo Baggins that it just didn't get.