I think ‘penalty’ is more concrete and often used with sports whereas ‘punishment’ is a more general term.
However, when you combine ‘punishment’ with other words you can create a specific term such as ‘capital punishment’.
Let’s see what Alan has to say on this issue…[YSaerTTEW443543]
Torsten has asked me to add a bit, which I’m pleased to do. PENALTY is very often a financial imposition put on someone when they’ve broken a law, regulation. For example you get penalty points on your driving licence if you exceed the speed limit and when you have acquired a certain number you can lose your licence completely. There is a fixed penalty for stopping a train without a good reason. As Torsten says, it is also used in various sports where a player has broken one of the rules. It is in these senses an impersonal matter where the offender/wrong doer loses points or pays a sum of money to account for the wrong doing. Another word is FINE, which means very much the same.
PUNISHMENT is a personal retribution for wrong doing and has a moral implication. The idea is that a person is punished RECEIVES PUNISHMENT for doing something wrong and thereby suffers by for example being sent to prison, losing certain privileges, or being made to give up what they enjoy. And as Torsten says, there is CAPITAL PUNISHMENT where the wrong doer is put to death by the state - incidentally something that fortunately has been abolished in the UK