Idaho National Laboratory painstakingly built Curiosity's nuclear power source that's supposed to outlast the previous two rovers by many years (keep in mind they were designed for 90-day missions!). Even after 10 years on the surface the generator will still be producing 89% of its rated current. The longevity of the mechanical components are probably at more risk of failure than lack of current from the power source.
Here's a video from the lab (more of a slideshow I suppose) that shows how stacks of tiny plutonium-iridium chunks are loaded into graphite shells, then into the main power generation equipment. The video also covers the detailed testing process that the power source must go through to prove it can survive being launched on a rocket and landing on Mars.