Quick Question on a simple Potentiometer sketch

The value of the pot is immaterial in the calculation pretty much, because it is wired as a potential divider.
The 1023 represents the number of steps in the ADC because it is a ten bit device.