Goldfish have the potential to live for quite a long time if they are well cared for. On average, they can live anywhere from 10 to 15 years in captivity. However, with optimal conditions and proper care, some goldfish have been known to live for over 20 years or even longer. It's essential to provide them with a suitable environment, proper nutrition, and regular maintenance to ensure they thrive and live a long, healthy life.