People often talk about "hacking" a Facebook account, but they don't usually mean it in the traditional sense. They're not using software to crack the code, but simply logging onto an account for which they already know the password -- or accessing an account through a computer with saved login information.
Still, is going onto someone else's account illegal, no matter how you do it? Could you face charges for updating the account or posting messages under someone else's name?
This is a tricky situation and people have very different opinions about what should be done, but courts in the United States have ruled that it can be illegal to go onto someone else's profile. One user was given charges for identity fraud when he logged onto a young woman's profile and altered her description in a sexually graphic manner. He also posted on her Facebook wall. It may have been a joke, but the identity fraud charges were felony charges, so it became serious very quickly.
In that case, someone else had gotten the password and then passed it on to the young man, perhaps through text message.
This isn't to say that every instance of using another person's Facebook account is going to be looked at as a serious white collar crime, but the precedent is out there in the U.S. legal system, and that's important to note.
Computer crimes are typically a bit complicated because the technology is changing quickly and many laws are vague and already outdated. Those who are facing serious charges under these laws have to know what legal options they have when going to court.
Source: Tech Dirt, "Court Says Logging Into Someone Else's Facebook Page And Posting A Message Can Be Identity Fraud," Mike Masnick, accessed July 14, 2016