When it's closed, is it lined up? If so then the bushings of the door hinges are worn/gone and need replaced. If it's misaligned even while closed then adjustment steps below should be followed.
Open the door and, using a proper socket and wrench, remove the far bottom hinge bolt. Close the tips of a set of measuring calipers onto the thread end of the bolt to determine the inside diameter of the washers you will need for the bolt.
Replace the bottom bolt in the hinge and screw down just until the bolt head comes to rest against the surface of the hinge.
Open the door as far as it will go. Place two hydraulic floor jacks under the car door, one nearest the hinges and the other near the end containing the door handle. Place a 4-foot 2-by-4 board across the tops of the two jacks and place a carpenter's bubble level in the center. Adjust either one of the jacks until the board is leveled.
Slowly raise the board up against the underside of the door, just until the board begins to touch the surface of the door on the end which is sagging. There will be a gap between the board on the hinged end of the door nearest the hinges. Keep the board level by pulling each jack handle one time, alternating back and forth between the jacks.
Loosen all hinge bolts by no more than one-half turn. Pump the handle of the jack nearest to the hinges a half pump, and then pump the handle of the further jack one full pump. Remove the bottom two bolts from the bottom door hinge and loosen the top bolt 3 to 4 turns so the hinge pulls away slightly from the frame.
Place washers between the rear side of the hinge and the door frame and slide the bolts through the hinges and the washers, continuing to screw them into the frame. Use one washer on the middle bolt and two washers on the lower bolt. In doing so, you are providing a " shim" which raises the rear of the door by approximately 3/8 inch.
Lower the jacks away from the bottom of the door and screw in the hinge bolts tightly. Slowly and carefully close and open the door several times to test operation of the door. If the door continues to sag, repeat steps 3 through 6, adding only one washer to the bottom hinge bolt and tighten. Test the door once again for proper operation.