I think you’re talking about the episode where Jem sneaks into the Radley yard and tries to peek through the back porch window to see if he can see Boo. Jem gets scared when he sees a shadow pass along the wall of the house and runs away, only to get his pants caught on the Radley fence. In an attempt to get away, he takes off his ripped pants and leaves them there. When Nathan Radley (the scary shadow Jem sees), shoots his shotgun in the air as a warning for the intruder, everyone in the neighborhood comes out to see what is going on. That is when Atticus catches Jem without pants. When Atticus asks Jem where his pants are, Dill tells Atticus that Jem lost them playing strip poker. Not only does Dill lie, but playing strip poker is not a proper thing for children to do. Luckily, the excitement of the shotgun blast distracts Atticus away from further cross-examination of the half-naked Jem. Jem and Dill go to bed, and Jem sneaks out to go get his pants, and he finds them mended laying over the Radley fence.
Dill, a master at making up stories and lies, could have gotten in trouble for lying and for playing the “adult” game of strip poker as well. Atticus, however, put two and two together and figured out what Jem and Dill had been up to. Luckily for Dill, Atticus didn't make a big deal out of it. He probably felt that Jem and Dill learned their lesson by being scared and almost getting caught trespassing on Radley property.