Either broken jack or loose solder joints.
If you do take the laptop apart, document every screw and tape them down to post it notes (trust me). Example, write "Bottom Cover, 6 screws 4mm", "Keyboard, 4 screws 2mm" etc. When you get down to the motherboard, be more specific in your descriptions... "top left corner, 2mm", "middle right, 2mm" etc.
There are an unbelievable amount of screws in a laptop, I repair these things, I know. It can be a nightmare and a major headache when you forget where they went! Stack the post it notes in a pile as you go. When the repair is complete, just go in reverse until the pile is gone. This guarantees 100% reassembly.
After the repair is complete, I would suggest getting a short pigtail and find a means to anchor this pigtail to the body of the laptop. Then plug your headphones into the pigtail. Sure it may wear out, but this is easily replaced.
Your other alternative is to take it to a quality repair shop. They will charge 100 - 200 dollars to fix the jack.
Good luck!
~Zip