Punishment has to do with some penalty that a person receives for doing something wrong or unlawful.
Visitation refers to a privilege that is given to a person who has received a punishment or is under some restriction. Visitation involved being able to see someone (a child, for instance) at a set time and for a limited period.
A father who has divorced his wife may have visitation privileges to see his children on weekends.
One more meaning - in religion, a visitation is a punishment from God. It can be a benefit, but it is usually a punishment.