Most people know that it's illegal to open mail that is addressed to someone else. In fact, there is a federal law that makes it a crime to do so. The good news is that the law only applies under very specific circumstances.
Accidentally Opening Someone Else's Mail
A federal statute known as 18 USC Section 1702 makes it illegal to open correspondence addressed to someone else. However, the law cannot be applied if you did not recognize that the mail was not yours when you opened it. For example, if you received several items in the mail and were opening all the envelopes without paying particular attention to the addressee, it is conceivable that you could open mail that was not yours. Because you did not recognize the mail as belonging to someone else before you opened it, no crime has been committed.
After You Accidentally Opened Someone Else's Mail
Although you may have opened someone else's mail unintentionally, what you do with it afterward is what really counts. Toss the mail in the garbage, and you have intentionally obstructed the delivery of that correspondence. That is a crime, and there may be consequences. The best practice is to write Return to Sender or note Wrong Address on the envelope and pop it into a mailbox. This way the letter can still eventually reach the intended recipient.
Intentionally Opening Someone Else's Mail
The U.S. Postal Service is mainly concerned with mail that is stolen from their custody. In other words, once they have delivered mail to your box it is no longer in their possession and they are relying on you to react appropriately if correspondence has been mishandled. The statute mostly addresses mail that is wrongfully removed from Postal Service custody, such as if it is stolen from a Post Office, a letter carrier or a mailbox. Should the stolen mail be used to conduct another crime, like identity theft, then the thief might be facing additional charges.
A person who steals mail from Postal Service custody may be looking at as much as three years in prison. That sentence may be in addition to or concurrent with other prison terms that the thief is sentenced to in relation to other crimes they may have committed after stealing the correspondence. Sizable fines may also be involved. Considering the consequences, stealing mail hardly seems worth the effort.