To keep drywall securely in place, the screws you use must be the right type for the materials involved, and they must be the appropriate length. Most drywall screws have "trumpet" or "bugle" heads designed so they can be slightly recessed into the panel without breaking the drywall's paper covering during installation, but not all of these screws are the same.
Screws used to attach 1/2-inch drywall to wood framing should be long enough to go into the wood at least 5/8 inch. You will want to choose a screw that's at least 1 1/4 inches long. Use screws made specifically for attaching drywall to wood. These screws have large, coarse threads that give them a lot of gripping power in the wood.
To properly attach 1/2-inch drywall to metal framing, the screw should penetrate the metal at least 3/8 inch. This means that the screw must be at least 1 inch long to securely hold the drywall in place. There are two types of screws designed for use in drywall-to-metal connections: fine drywall screws for 20- to 25-gauge metal framing, and self-drilling drywall screws for 12- to 20-gauge metal framing. Both types have finer threads than screws designed for mounting drywall to wood.