John Locke postulated the Social Contract, whereby government authority exists merely because of the consent of the governed. When that consent is withheld, then I think Locke would argue secession is justified. There's a strange historical force at work in these scenarios though, in that, when a state or nation declares independence, this is often resisted at the federal level, sometimes legally and sometimes with force. The American Revolution is one such case. Today we would argue that our separation from England was legal, in no small part because we won. The South seceding in 1860 and 1861 was ruled illegal, and they lost, and even today courts argue they have no legal right to do so ever again. So is the only difference in legality that of military victory?
As mentioned in the above post, the U.S. Supreme Court banned any possibility of future secession in Texas v. White in 1869--just four years after the end of the Civil War and the short life of the Confederate States of America. The court did add in its ruling, however, that another revolution might succeed in creating a successful secession of multiple states. Many Americans--both before and after the Civil War--believe that secession is a right that individual states should hold. Thomas Jefferson was a vocal advocate of the right of secession.
President James Buchanan agreed with Jefferson, claiming in 1860 that the nation should never use force to make states compliant.
"The fact is that our Union rests upon public opinion, and can never be cemented by the blood of its citizens shed in civil war. If it can not live in the affections of the people, it must one day perish. Congress possesses many means of preserving it by conciliation, but the sword was not placed in their hand to preserve it by force."
Apparently, more than one-fifth--22%--of all Americans still believe in the right of states to peaceably secede, according to one recent poll (Zogby International, 2008) poll. Several of the U.S.'s closest allies, particularly Canada and Australia, still occasionally debate the issue.
This depends on if you are talking about the legal right or the moral right to secede from the Union.
Legally speaking, there is no right to secede from the United States. The Constitution does not set up any procedure for seceding from the Union. The Supreme Court has only ruled on this once (in Texas v. White) and it ruled that there is no such right.
Morally speaking, this is a question that has no concrete answer. A state would presumably have the moral right to secede if the United States as a whole were to pursue some policy that was fundamentally wrong. For example, I would argue states would have the right to secede if the US as a whole reinstituted legal slavery or if the US as a whole established a state religion. However, this is simply an opinion and there is no way to objectively define when a state would have the moral right to secede.