Question: are you supposed to drill into a stud?
Answer: Take off the switch plate and you can see which side of the stud the box is mounted on by spotting the screws. Most wall framings set studs every 16 inches, so you should be okay to measure from there, but double-check with a pilot hole. You need to drill through the plaster and into the wood framing.