The correct option is C to turn off
Here, "to turn off" is the correct grammatical construct and fits the given sentence. As the sentence is in simple past form, the blank should also be filled up with simple past: "Shekhar forgot to turn off the lights before he left". Thus C is the answer.