Is an invasion of privacy a crime? That depends on the specific law being violated. For example, HIPAA requires criminal penalties if a liable party knowingly shares medical information and more severe penalties if the information is sold or otherwise used for personal gain. In many cases, privacy violations result in civil penalties (fines and damages) rather than criminal ones like prison sentences.
Note that this is a separate issue from defamation. It's generally impossible to slander or libel someone after they have died, although some states do have antidefamation laws that apply after death.
When it comes to electronic accounts or records, however, things get a bit complicated. There aren't really laws that specifically cover who can have access to your e-mail account or your Facebook page after you die. Ownership of those accounts is controlled by the user rules and regulations of the site in question. A typical rule is that the site deletes inactive accounts, so for some period of time (say, 90 days) after death, the account exists and is still "owned" by the deceased person. If that person's family has the passwords, it can obviously gain control of those accounts, and this would probably be considered authorized access. It might be difficult for family members to gain control over an account from the site owners themselves if they don't have the proper passwords.
If someone "hacks" the account of a dead person to gain access to it -- as a number of News International employees have been accused of doing recently -- they haven't necessarily violated any privacy laws (although they may have, depending on the jurisdiction and the specific circumstances). What they will almost certainly have violated are laws against unauthorized intrusion into electronic accounts. In that case, a crime has probably taken place, but the victim's death mitigates the crime somewhat. However, some may think it a more ghoulish and violating act because of the anguish it can inflict on the deceased person's family. In the end, it doesn't matter if someone is dead or alive – accessing his or her account without permission is illegal.
For more information on privacy laws, see the links on the next page.