[SOLVED]What is this component called and how do I connect it to my arduino?

It is a potentiometer.

Look here: http://www.arduino.cc/en/Tutorial/Potentiometer