Criminal defendants generally can’t appeal “lawful” sentences. But a defendant can appeal a sentence if it’s illegal, unconstitutional, or unreasonably excessive. For example, if a judge imposes a sentence that exceeds the maximum punishment allowed for the crime in question, an appeals court would have the power to correct the sentence.
(For information beyond this article on the kinds of errors that can lead to resentencing or sentence modification, see Appeals and "Harmless" Errors.)
In some states, however, if the defendant didn’t notify the sentencing judge of an illegal sentence, the appellate court cannot review it. (The means by which defendants are supposed to notify the trial court depend on the jurisdiction—an example is a petition for review of the sentence.)
Federal courts follow the Federal Sentencing Guidelines in imposing sentences. Occasionally, a judge “departs” from them and sentences the defendant above the top of the guideline range for the offense. But an appeals court will reverse the sentence only if the judge abused his or her discretion, or imposed a sentence above the maximum set by the statute that defines the crime.
On the other hand, a judge may refuse to depart “downward” in sentencing a defendant, meaning that he or she won’t issue a sentence that’s lower than what the guidelines call for. In that scenario, the appeals court will review the sentence only if the trial court made a mistake about its authority, such as wrongly presuming that it didn't have the discretion to depart from the guidelines.
Some states allow review of a sentence if it was potentially “disproportionate” to the crime even if it wasn’t above the maximum allowed by law. In federal court, a review for proportionality is required for death and life without parole.
In setting the standard for reviewing a sentence for proportionality, the Supreme Court held that it was disproportionate to sentence a man to life in prison for issuing a bad check despite his criminal history. (Solem v. Helm, 463 U.S. 277 (1983).)
(For more on a related topic, see The Meaning of "Cruel and Unusual Punishment.")
The law also protects defendants from vindictive sentencing. For example, if a defendant succeeds on appeal and her case goes back to the judge for resentencing, then that judge’s new sentence is presumed to be vindictive if it’s harsher than the original punishment and there isn’t new information to justify it.
The terms of plea bargains often require defendants who plead guilty to waive the right to appeal the conviction or sentence. But if the sentence imposed by the court was beyond its authority, then the waiver of appeal may not apply. Also, if the lawyer was deficient—for example, by failing to advise the client of the consequences of the plea—then the defendant may be able to attack the sentence. (This amounts to claim of ineffective assistance of counsel—for more, see Ineffective Representation in Plea Bargains.)
It’s very important to seek the advice of an attorney before trying to appeal a sentence. Only a lawyer familiar with the laws of your jurisdiction will be able to evaluate whether there are any grounds for an appeal, and how you can best pursue resentencing.