Suppose a stranger steals 100$ from me, then has second thoughts and puts it back, before I ever come to look for or need the 100$. If discovered, should he be punished? Why or why not?

I am tempted to ask: What would you think if the roles were reversed, and you were the one who took the $100 from a stranger and what you would hope the stranger's response would be if it was discovered that you took the money and then gave it back? But I will try a different approach. Taking the case as you describe it: I suggest you would be within your rights (and not wrong) to report this as a theft and the stranger would then face whatever penalty the law specifies for petty theft, but I think you would also be within your rights (and not wrong) to not report this. Imagine that the stranger changed his or her mind within just two minutes and apologized profusely to you, perhaps even offering you the lottery ticket he just bought (and did not steal) and this gives you a finite chance of winning millions later in the week. Still, a theft or stealing has taken place even it the funds are returned. Imagine that the stranger stole millions from a pension account for hundreds of vulnerable, retired...

John is 30 years old. Jack is 10 years old. They are clinically sane. One day, John feels a sudden, uncharacteristic urge to kill. He murders an innocent stranger. On the same day, Jack feels the same urge to kill. He also murders an innocent stranger. John and Jack both admit responsibility for the murders. They acted in the same way for the same reason. Their actions had the same result. Should they be punished in the same way?

Great question! In practice, at least in the United States, the punishment and even the trial will be different. The 10 year old would be tried in juvenile court. The jury would not be made up of only 10 year olds. John, on the other hand, would have a jury (if there was a jury) of fellow adults or peers, and the possible consequences would be different. I suggest that one reason for a difference in punishment is that while both John and Jack admit responsibility (which I assume involves admitting that they knew that what they did was wrong) the child (and a 10 year old is a child, based on international standards, e.g. UN definition of childhood) did not have as full of a grasp of the wrongness of the action as the adult. It may also be the case that the child had / has less resources mentally to address deviant desires / urges. I think we expect adults to engage in greater self-mastery, to exercise greater restraint and control of desires than children. Although the claim may seem odd: sanity...

Is it morally acceptable to punish? And at what stage does punishment turn to revenge? Comparing something like lex talionis (which seems like revenge) with rehabilitative/correctional systems (which seem restorative), it seems that certain forms of punishment are more ethical than others.

What is quite interesting about the lex talionis ("an eye for an eye....") is that it functioned to limit retaliation (e.g. if my neighbor injures my eye, I am not thereby authorized to kill him and his family). In any case, there are many theories of punishment. These include the notion of retributive justice, the communication theory of justice, utilitarian theories, and so on. Keeping this reply short, you might consider a thought experiment (not my own) that will test your views about punishment and revenge. Imagine someone has done great harm to those you love --imagine a case in which someone killed a member of your family due to driving while intoxicated. Consider now two possibilities: in the one the person is punished (proportionately) and through this he comes to understand that what he did was wrong (imagine that until this event he lived as though he had little or no responsibility for others). Imagine, too, that through this process he becomes rehabilitated and even (when released...