This is actually a scene that differs between the text by Harper Lee and the screenplay by Horton Foote. This conversation doesn't occur in the Lee text; when Walter Jr. is invited to eat lunch at the Finch household, he and Atticus talk about farming and crops. Walter Jr. comments that he has a tough time at school because he has to stay home every spring to help out with farm chores.
In the screenplay, Walter comments that he hasn't had roast in a long time. Instead, his family consumes "lots of squirrels and rabbits," which he and his father obtain through hunting. This catches Jem's interest, and he begins asking more questions about Walter's gun. He then turns to Atticus, asking his father how old he was when he first got a gun.
Through this conversation, the audience can infer that Jem wants his own gun. Walter Jr. is younger than Jem is and already has a gun. Jem is approximately the same age that Atticus was when he got a gun, so he seems to be building a case that he is old enough to handle this responsibility and privilege. Atticus, an ever-intuitive parent, recognizes this and conveys the importance of never using a gun to destroy beautiful creatures like mockingbirds. This advice is key to the central themes of both the novel and the screenplay.