They are both correct, but if you use a pronoun, then it must come before the particle:
turn the light on
turn on the light
turn it on
turn on it
With verbs where it is optional to separate with a noun, it is not optional with a pronoun- you must separate with a pronoun.![]()