If a woodscrew becomes loose the best treatment is to move it to a new position, when possible. If a door hinge is pulling away it might be moved far enough for the screws to be driven again into solid wood. When this is done, the old holes should be plugged to avoid wood fibres opening towards the new holes and again loosening the screws. In a simple case of a screw loosening it may be sufficient to push a matchstick into the hole and to tighten it again.
If a screw has to be driven into the same place again, the hole should be drilled to take a hardwood dowel, which can be glued in, then drilled for the screw. It may be better to enlarge the hole enough to press in a plastic or fibre wall plug. Push it in below the surface, so that as it expands it does not lift the fitting from the surface.
It may be possible to drive the screw into its old hole, if this is filled with a mixture of glue and sawdust. Do not put any strain on the screw until the glue has set. Driving a longer screw into the same hole only gets the benefit of the grip of the end, but if a stouter gauge screw can be used there should be a good grip along it. If the problem is that the screw is being driven into end grain, it would be a help to drill and fit a dowel across the screw hole, so that part of the screw thread goes into the cross grain of the dowel.
If a door has sagged at the hinges and needs to be rehung, make sure the knuckles of the hinges are in line with each other and that they project from the surface screw enough for the door to swing clear. Use a wedge under the door to hold it at the correct height while one screw is driven into each hinge. If the door swings properly then, drive in the other screws. If not, take the screw out and try again using a new hole.