There was some initial confusion, as CNN and Fox News originally reported that the mandate had been overturned. Here's a pretty good summary of the decision from Huffington Post.
Chief Justice John Roberts wrote the majority decision, which carried by a 5-4 vote.
(My own somewhat specious theory for the surprising vote is that the rest of the SCOTUS judges are tired of Justice Scalia's incessant political posturings under the guise of dissenting opinions and decided to piss him off, just for giggles.)
Also, the Washington Post has just put up an excellent interactive post that you can fill out to learn how the new healthcare law will affect you personally.