Then do i need to buy a shield or something if i want to store a larger program
The short answer is you'd have to buy another chip that either has more memory, or can access external memory.
The longer answer is that you'd have to be doing quite a bit to run out of memory with an Arduino. The chip itself does a lot of things without requiring supervision by the program. For example, say you're building a photovore, so you need to read two analog inputs, and use those values to set PWM output for motors. That might only require enough code to set up the registers, and nothing at all in the main loop.
I got into this stuff as a Unix/linux programmer, and it took some doing for me to get used to how much stuff these little 8-bit chips can do on their own. The compiler settings used by the Arduino environment are setup to optimize for size, and the optimizer does a good job. For now, I'd say don't worry about it, just write programs. If you run out of memory, worry about it then.