In the Season 3 of Game of Thrones, I didn't understand that how the Stark family got two little children of the Lannister family as prisoners?
In the 3rd episode of season 3 "Walk of Punishment" it was revealed that Edmure Tully (the uncle of King Robb Stark) disobeyed orders and attacked Gregor Clegane. Edumre won the battle and Gregor fled, but Edmure was able to capture some hostages including Willem and Martyn Lannister. We never see the battle, but it is discussed when King Robb chastises his uncle after the funeral.
There is a scene in S03E03, Walk of Punishment in which we learn the Edumure Tully captured the boys after a battle with Gregor Clegane (as seen below):
[Edmure] We took hostages. Willem Lannister, Martyn Lannister...
[Robb] Willem and Martyn Lannister are 14 years old.
[Brynden] Martyn is 15 I believe.