aim properly and don't rush
I was once caught in a planet's gravity well when I was still learning how to play. I was interdicted and dropped out of SC as I was too close to the planet (luckily sans interdictor). I was too eager to get out of there and rushed it, maxing out at 100 km/s. Thought I wasn't moving, but I was, just incredibly slowly. Dropped out of SC and tried again, but didn't receive the 'escape vector' message, probably because I was poorly positioned (and that time my max speed was 30 km/s). Third time was a charm, and I took my time over it. Once I was well away from the planet I was able to toddle off to my destination.
I suggest you position your ship so that the planet is directly behind you. Then when you try to enter SC the escape vector should be ahead of you. Let your speed go up till it's measured in 'c' and by then you should be far enough away to wend your merry way.
Here is my first attempt. You can see that I was too eager by looking at the scanner. See how the planet's gravity 'sphere of influence' covers much of my scanner, and the escape vector is shown on it as I veer off, disappearing when I'm angled away from it.
A gravity well is essentially the pull of the astronomical body. It has you in its grip and you are falling 'down the well' towards it.