ISO is the culprit of an image looking grainy. The term ISO comes from the days of film photography, and refers to the sensitivity of the film roll. The higher the ISO, the harder the film would work to absorb the available light. Digital cameras of today use this same system to measure light sensitivity.
If you want to avoid grainy photos, be sure to keep your ISO down; around ISO 400 is a good benchmark.
A low ISO, such as 100, can be used when you're in a bright environment like outside on a sunny day. It can also help reduce the noise in your photo, and keep your images sharp.
You may want to avoid using a high ISO if you are planning on printing or displaying your photos at a large size, as the grain will be more noticeable when blown up.