The wiki gives a good summary of likes, dislikes, boons, punishments, and popular strategies for each god. Alternatively, just try doing things you think that your god might like or dislike, and see what happens. Once you learn an approved or disapproved action, it will be revealed in your in-game guide.
Basically, think of piety as your spiritual bank account. It can never go below 0, and it has a maximum of 100 (unless you take Consensus from the Pactmaker, in which case the maximum is 50).
You earn it by walking on the ring of sparkles around an altar (each god has its own colour sparkles, for instance Mystera's are purple, but you get +1 piety for any sparkles, regardless of which deity if any you are following), by performing actions your god approves of, as a sign-up bonus for certain gods, and from the special Consensus deal you can make with the Pactmaker (a special type of god).
You spend it by asking for boons, converting to a different religion (lose half your piety, and you must have 50 to convert), Pacts, and on actions that your god disapproves of. You get punished by your god if you cannot afford to pay the piety cost of a disapproved action, and by any god if you commit a serious sin against that god (usually desecrating their altar).
None of this carries forward from one run to the next; the only thing that affects future runs is unlocking a new god, whose altar can then randomly spawn in any standard run. If you upgrade the Church, you can force a particular god's altar to spawn as a preparation, but there are drawbacks for doing this.