The NEC requires that a hole through a stud for wiring be 1 1/4 inches from the edge of the stud, unless the stud is covered by a steel plate. So the screw should not be more than 1 1/4 inches longer than the sum of the thicknesses of the bracket and the drywall (probably 1/2 inch).
For a permanent, strong installation, I would put a piece of plywood between the bracket (or whatever) and the drywall to spread the load, which otherwise may crush the drywall and loosen the attachment. For my display tracks, I knew that I would need to screw numerous brackets to the wall at inconvenient locations. So I simply covered the entire area with white-painted 1/2-inch plywood first, screwed into the studs, then mounted the tracks to the plywood.
Another trick is to make a hole in the drywall and stack flat washers directly against the stud to get a hard surface flush with the drywall, to avoid the unsightliness of the plywood.
Bob Nelson
Screws usually don't work loose when run in tight into wood, can't say the same thing for drywall or particle board which is sawdust glue and formaldahyde. When using drywall plugs remember that the drywall will work loose over time so try to find a wood 2 by 4 behind the wall. A # 10 screw about 2 inches long will work to hit the wood.
Lee F.
I'd worry about the screws eventually working loose.
Poppyl
Modeling the "Fargo Area Rapid Transit" in O scale 3 rail.
Our community is FREE to join. To participate you must either login or register for an account.
Get the Classic Toy Trains newsletter delivered to your inbox twice a month