Welcome to Tropical Fish Keeping!
Goldfish are beautiful fish, but require a lot more attention than most people realize. They foul the water quickly, and long exposure to it will stunt their growth (which can lead to further health problems and shorter life expectancy). They need a strict water change routine.
Many people believe that the minimum
tank size for a common goldfish is 55g to 180g. I personally think that it should be no less than 90g, and above that would be even better. They need a lot of swimming room, and the larger quantity of water helps keep the toxicity down (assuming proper maintenance is taking place).
I would definitely recommend saving up for a larger setup. More than likely your goldfish's growth has already been stunted some, due to living in less than ideal conditions at your local fish store, but it can still reach a good size. I would get ready to get him something at least 55 gallons, but more if you can afford it. Either way, it still gets a way better life than it would have had at the pet store. :)
Hope this helps! Feel free to ask questions if you have any. This is a really good community. We also love pictures if you wanted to show off your goldfish. :)