Curiosity, we know, has no little nuclear reactor, it has a RTG. Great! But how long will it last? For how many years will our little 1-ton friend be roaming around another planet?
Because of the nature of radioactive decay, Curiosity is going to get a whole lot more than 2 years out of its power source. Curiosity will be getting enough power to keep active for a bare minimum of 14 years (see Specifications> Power Source), though the amount of power it has will steadily decrease over time (from 125 Watts initially to 100 Watts after 14 years). I don't think the battery is likely to be the limiting factor in this case.
Note: The two year figure cited in Undo's answer is actually only the time of the rover's first mission, though it will continue to be reassigned new missions until it eventually gives out.
First of all, most space missions are speced such that the power at the end of the mission will meet 100% of the demand of the spacecraft. The mission of Curiosity is 2 years, thus, the spacecraft will have 100% of required power after 2 years. However, there comes to be a bigger question, does the spacecraft need 100% power to continue on?
Beyond that, it's power will decrease. However, Curiosity has two batteries which will allow it to store charge, allowing it to still perform high power tasks, just for less time than it otherwise would be able to. So what will happen is the amount of moving, science, etc will be decreased over time.
In practice, as Plutonium 238, the element used, has a half life of 87 years, the effect of the radioactive decay will be minimal. I would be more worried about the lithum ion battery than the RTG.
Let's take a closer look at the nuclear cell.
According to According to NASA;
Radioisotope power systems are generators that produce electricity from the natural decay of plutonium-238, which is a non-weapons-grade form of that radioisotope used in power systems for NASA spacecraft. Heat given off by the natural decay of this isotope is converted into electricity, providing constant power during all seasons and through the day and night.
It contains about 10lbs of plutonium-238. Great! Now how long will that last?
Again, from the same NASA page:
This type of power supply will give the mission an operating lifespan on Mars' surface of a full Martian year (687 Earth days, a little less than two Earth years) over a wide latitude range.
So we have about 2 years of the rover being able to be run on nuclear power. After that, though, it should be able to run for another twelve-ish years on its MMRTG.