With the outer pins across the supply, the wiper voltage is
V_wiper = 5 V × (position from the GND end)
so a 5 V Arduino reads it with analogRead as 0 at one end, about 512 in the middle and 1023 at the other.
int value = analogRead(A0); // 0 … 1023
int brightness = value / 4; // 0 … 255, for analogWrite
10 kΩ is the usual value: low enough for the ADC to read accurately, high enough to draw only 0.5 mA. If turning the knob clockwise makes the value go down, swap the two outer wires.