Wiggle the lead but keep the jack and socket still, if it changes then, its the lead.
If its the jack/socket connection, you've got corrosion on either the jack or the socket or both. Jack is easy to spot and easy to clean (shirt or jeans).
The socket is a tad harder, its either the tip or the sleeve. Look at the tip of the socket, if you see a small bit of discolouration in the middle, get a piece of paper and rub that against it till until its all clean (or close enough to clean). If that doesn't solve it, its the sleeve, in which case I wrap paper around a screwdriver and use that to polish it up. However, I find these are temporary fixes at best and you're better off replacing the socket (doubly so for the barrel-type ones).
If the talk about tip and sleeve is confusing,
this might help.