Divine retribution is the consequence of having incurred penance with a god.
How Retribution occurs
Every time you gain some experience a counter is decreased. When this timer reaches 0, there is a 5% chance for each god angry at you that you will suffer wrath before 300 auts have passed. On average, the wrath counter will reach 0 once every 0.5% of an experience level. In other words, you will suffer 10 retributions per XL for each god.
Owing penance to multiple gods means you will suffer wrath more frequently, but it will not last any longer. It is even possible, albeit very unlikely, to suffer retribution from two different gods in a single turn.
Retribution and Good Gods
Good gods will not visit retribution on anyone except the followers of gods they hate - which means that if you abandon a good god, you cannot diminish the penance you owe them except by returning to the fold (whereupon pious actions will atone for your sins) or by turning to the worship of an evil god (and thus unleashing the wrath of your former god). However, it does mean it is safe for characters worshiping good gods to switch to a non-evil (and also non-chaotic for Zin) god.
When a god's retribution is unleashed on you, it is possible for it to be "overwhelming". If retribution is potentially overwhelming, there is a chance given by
one_chance_in(5) && (you.experience_level < random2(37))
If you are still worshiping the god whose wrath you have incurred (e.g. if you attacked an allied orc as a Beogh worshiper), you can reduce your penance simply by gaining piety. Often you can get out of penance before your god inflicts any wrath.
Additionally to any penance reduction arising from the god's retribution action itself, every time you are the subject of divine retribution, your penance owing to that god is reduced by 1d3 points.
If the penance is reduced to zero, you will see the following message:
<god> seems mollified.
Estimating Penance Counter
You can estimate your penance counter by looking at the Favour description on your religion screen (command ^).
|Godly wrath is upon you!||50+|
|You've transgressed heavily! Be penitent!||20+|
|You are under penance.||5+|
|You should show more discipline.||4 or less|
This will only be visible for a god you are currently worshiping, which means that unless you are intentionally incurring penance with your current god, you will probably never see anything but "You should show more discipline." on the ^ screen.
You can also pray at the altar of a god you no longer worship to get an estimate of your penance counter with that god.
|... wrath is upon you!||50+|
|... annoyed with you.||20+|
|... well remembers your sins.||5+|
|... is ready to forgive your sins.||4 or less|
Prior to 0.14, divine wrath was applied approximately once every 2000 turns, and could be waited out.
Prior to 0.11, the check for retribution every 20 turns would first pick a god whose penance you were under, then determine if that god would exact vengeance upon you. Thus, when you were under penance from multiple gods, you would be under penance for longer, but you would experience a given angry god's wrath less often. This could be exploited to "dilute" particularly nasty god retributions in the early game, such as Lugonu's, by joining and abandoning multiple gods with more manageable retributions (such as Xom or Zin).
Prior to 0.9, good gods would not place under penance followers who abandoned them for another good god. This was removed because it allowed players to choose which good god would exact retribution if they wanted to join an evil god. This technique was usually used to avoid the Shining One's wrath.