The punishment Jem gets is not from Atticus at all. Jem is "punished" in that he is faced with racism and truth. There is no indication in the text of hatred for African-Americans until this point - the children love and respect Calpurnia and have been raised to do so by their father. Additionally, Jem learns the truth about the white trash living in the area. Just as he has never been confronted with racism, he has not been confronted with violence, ignorance, and mob mentality (i.e., the shock of seeing Walter Cunningham's father).
In my opinion, this is a trick question which would be more appropriately punctuated, "What 'punishment' does Atticus give Jem after Jem refused to leave the jailhouse mob scene?" This is because Atticus gives Jem no punishment at all. Let's set the scene:
I assumed that Atticus was giving him hell for not going home, but I was wrong. As they passed under a streetlight, Atticus reached out and massaged Jem's hair, his one gesture of affection. (Lee 155)
At the jailhouse, Jem's stubbornness and defiance is ironically what saves Atticus. If Jem had truly gone home at the original moment that Atticus demanded, there could have been a bitter and gruesome fight. Defiant? Yes. Justified? Yes. Jem was faced with one of those contentious moral decisions that one hopes never to face. Jem stood on the side of justice, . . . and punishment was neither needed nor deserved.