First decide on a type of doorstop. Choose from a wall-mounted rubber stop that cushions the impact of the door handle, or a spring-loaded or solid-shaft stop that mounts to the baseboard.
Mark the exact spot where the doorknob comes in contact with the wall if you're using the wall-mounted type. Attach the stop to the wall using the supplied screw. Consider using a plastic molly anchor if the doorstop's position leaves it with only drywall for support.
Locate and mark a spot on the baseboard about two inches from the swinging edge of the door if you're using a baseboard-mounted doorstop. Then either screw the shaft of the stop directly into the wall from its own base, or use separate screws to attach it to the baseboard.