The LM317 keeps 1.25 V between its OUT and ADJ pins, so the two resistors set the output:
VOUT = 1.25 V × (1 + R2 ÷ R1)
= 1.25 × (1 + 390 ÷ 240) = 3.28 V
Other common settings with R1 = 240 Ω: R2 = 720 Ω gives 5.0 V, R2 = 1.2 kΩ gives 7.5 V. Keep R1 at 240 Ω so the regulator's minimum load current flows through it.
Pin order on the TO-220 package, looking at the front with the legs down, is ADJ, OUT, IN, different from the 7805's IN, GND, OUT. That is the most common wiring mistake with an LM317.
Like any linear regulator it needs headroom (feed it at least about 2 V more than the output) and turns the difference into heat: (VIN − 3.3 V) × current.