I haven't read the books, but I'm assuming all this Theon crap is in there. The entire plot/spectacle of Theon was totally fucking pointless and worse than any of the gratuitous sex scenes or any of the other maladies the show endured this season. If it was in the books, it should have been cut out of the series.
All that happens in the books is that he is mentioned in reported speech and bits of the skin that Ramsay flays from him end up here there and everywhere. Roose Bolton presents a strip of Theon's little finger to Catelyn at The Twins as if to say "hope this makes up for the two sons he's killed." It becomes clear later that during the 2nd/3rd books he's been tortured, flayed, mutilated, had teeth removed and it's hinted he's been castrated. But none of it takes place in POV chapters i.e. we don't read about it in grim detail.
The actual story of Ramsay's infiltration into Winterfell and meeting Theon is much more intricate in the book.
Rodrik Cassel and his troops are hunting Ramsay down (I won't bore you with why). Rodrik's party comes across Ramsay shortly after he had raped and killed a peasant girl and his companion Reek (the first Reek, it's not just a cruel name for Theon) had raped the corpse. Ramsay is able to survive by switching clothes with Reek, who is killed in his place. Rodrik yearned to put "Reek" to death too but he needed him alive as he was a witness to many of Ramsay's crimes, so Ramsay narrowly escaped death due to his cunning and willingness to sacrifice others for his own ends. He's taken prisoner at Winterfell.
When the Ironmen attack Torrhen's Square, Ser Rodrik gathers a force to expel them, including most of the Winterfell garrison. The Ironmen under Dagmer Cleftjaw let him drive their force away, luring Ser Rodrik further away from the castle. The Ironborn under Theon Greyjoy then attack and take Winterfell. After Theon takes Winterfell he releases "Reek" in exchange for a vow of service. In fact, it's
Ramsay's idea to kill the two peasant boys to cover up for the Stark boys' escape, only being Ramsay, the bodies aren't burned like on TV, but flayed. Ramsay then (with Theon's knowledge) kills the three other Ironborn that know the truth about the boys identity, and they pin the blame on Farlan, the kennel master, and kill him too. Theon even considers killing "Reek" (as he knows him) to further cover his tracks, but seeing that he can read and write, he's worried that he's written the truth down somewhere.
Ser Rodrik gathers more forces, this time to besiege Winterfell. Rodrik parleys with Theon before the gates, demanding his life and the castle, but Theon threatens to hang his daughter Beth if an attack begins. Unwilling to abandon the castle, though harboring few delusions about how likely a victory is, Theon and the few Ironmen loyal to him prepare to make their final stand. Ramsay offers to help Theon by taking a large sum of money to the Dreadfort and returning with much-needed reinforcements. Theon reluctantly agrees.
After consulting with his father, Ramsay and his forces march to Winterfell just as Ser Rodrik Cassel and his host move to greet them. Ramsay swaps his serving man's garb for a full set of armor complete with a red helmet, and meets with Rodrik. As the castellan offers him his hand in friendship, however, Ramsay slices Cassel's arm off and leads his forces in a rampage through the stunned Northmen's ranks. Ramsay then rides to Winterfell's gates, and presents the corpses of Ser Rodrik, Leobald Tallhart and Cley Cerwyn to an onlooking Theon as a sign of his loyalty. Theon opens the gates and meets with Ramsay himself, who removes his red helmet and reveals his true identity. Ramsay carries out a great sack of Winterfell, murdering many of its inhabitants in cold blood, slaughtering the remaining Ironmen, and capturing Theon in the process.
The reveal of Ramay's true identity to Theon is priceless. "Ramsay. Snow, my wife called me before she ate her fingers, but I say Bolton." He then implies he wants to take Theon's mistress to bed, and when Theon goes to say something in outrage Ramsay punches him with his armoured fist, breaking his cheekbone instantly. When Theon wakes up, Winterfell is burning and his whole world is upside down.
Cunt.