When Mr. Pickwick is arrested and put in the Fleet, he tells Sam to leave him. Sam refuses. Mr. Pickwick insists, so Sam leaves... and goes and gets himself arrested so he can be put in the Fleet, too.
Later, near the end, Mr. Pickwick announces his intention to give Sam enough money for him to marry Mary. However, this would mean Sam leaving Mr. Pickwick. Sam objects.
Sam: If you vant a more polished sort o' feller, vell and good, have him; but vages or no vages, notice or no notice, board or no board, lodgin' or no lodgin', Sam Veller, as you took from the old inn in the Borough, sticks by you, come what may; and let ev'rythin' and ev'rybody do their wery fiercest, nothin' shall ever perwent it!
Mr. Pickwick: My good fellow, you are bound to consider the young woman also.
Sam: I do consider the young 'ooman, Sir. [...] I've told her how I sitivated; she's ready to vait till I'm ready, and I believe she vill. If she don't, she's not the young 'ooman I take her for, and I give her up vith readiness. [...] My mind's made up, and nothin' can ever alter it.
The 1952 film:
Jingle first causes trouble by borrowing Mr. Winkle's coat without telling him and as a result Mr. Winkle almost had to duel someone Jingle insulted. Towards the end, when Jingle, after a HeelFace Turn, is leaving for the West Indies, Winkle gives him the coat.