"How to solo and improvise" - quite possibly the biggest single open-ended subject in music today.
Ok - I assume you don't want to play like Allan Holdsworth (master improvisor) over your "Knockin' on Heaven's" door song and want something more like 70s era Clapton (noobs look it up - he has a nice version).
Okay - a bit of Googling revealed the following chord chart for Clapton version (sorry - i don't know the Burdon version, but I assume the chords are the same) -
http://www.ultimate-guitar.com/tabs/c/clapton_eric/knockin_on_heavens_door_crd.htm
So the chords are G D C Am, which means the key is G. (All chords in G would be G Am Bm C D Em F#Dim).
So, I make the assumption that you want to play a conventional solo with a matching scale in the same key and nothing too fancy at this juncture like outside notes, or changing modes on each chord etc.. which is a bit more advanced.
So, here's my recommendation:
Learn the G Major scale. G A B C D E F#.
Start by playing notes from this scale along to the music. Try to break up your lines into phrases - in other words, don't just play one continuous never-ending line (unless that's the effect you're going for). Clapton, for example plays short little bursts of notes, say, from 2 notes in a lick, up to between 6-12 notes. Now, the hardest part is this - you'll notice that when you end your phrases, some of the notes either 'work' or they don't although all the notes are harmonically valid within the key, at certain points, some of them sound better. The ones that sound better are the notes that correspond to the notes of the chord which is underneath at any time so:
G Major = G B D, so ending your lick on one of these notes (especially the 1st) will sound 'strong'.
D Major = D F# A, likewise
C Major = C E G, likewise
Am = A C E, likewise.
Now, how do you do this? Well one way is to memorise all the notes on the entire fretboard - good luck, see you in 20 years.
The other way is to memorise chord shapes along the fretboard (easier, but still several years of effort). So, you need to eventually learn, for example, all the different shapes of G Major over the entire neck in thr long run.
If this sounds too daunting, for your current needs, i suggest picking a couple of key positions and concentrating on knowing the chord shapes in those.
E.g.
5th position, know an Am Chord and some of the notes of C Major
12th Position, know a G Major and a D shape.
Of course, you can choose whatever/wherever.
To simplify things slightly more, superimpose the pentatonic shapes over each chord as it passes, and attempting to gravitate your lick end notes to the chord tones, so
G Major - play a G Major Pentatonic in the 12th position, and when the next bar comes and it changes to D, then finsih your lick on one of the D chord tones.
etc.
This is one way of soloing and applying scales to chords. I can't say I'm particularly good at this myself because I don't practice it enough. Like anything you need to do it a lot, but then, therein lies the fun. I've been trying to get this right for the best part of 20 years and I'm still having fun.
Happy journey!