The doors inside of your home serve many different purposes. They can block sound, control access for guests, pets or children, or they could just be there as a decorative aspect, not serving any particular purpose.
Whatever the reason for having an interior door is, you should make sure that it is safe and built well. A door that is poorly installed can do damage to your floor, to the doorframe and even in some cases, hurt people.
When a door swings on its hinges, there is a significant amount of shear force exerted, and this could even lead to the door pulling out of the door frame.
The door frame into which a door is installed needs to be firmly attached, and the hinges should be installed using screws that are sufficiently long to hold the door firmly in place. Usually you will be able to find a recommended screw length depending on the weight of the door. Make sure the door frame is square and plumb, as well, since it won’t be possible to attach the door properly otherwise.