Like DVDdoug said.
In newbie terms, you use the resistor to make it clear to the pin, what voltage it is at.
Either you connect the pin to 5V on the board or to ground with the resistor. This means, that you either "pull it up" to 5V or "pull it down" to ground level.
It overrules all the random noise, and you will not have weird readings from a floating pin.
In your setup (I guess it is a potentiometer), you have the two outer legs to 5V and GND, and read from the middle leg.
This is a voltage divider, and you do not need the resistor.
Let us say, that you have a button connected to a pin, and a pull up resistor to 5V.
The Arduino will read the pin as HIGH.
When you push the button, you connect directly to GND. This is a much more direct way for the electrons, and the pin will now read as LOW.
If you want to read an analog sensor, and it is not in itself a part of a voltage divider, you will have to make it part of a voltage divider with the help of a suitable resistor.