there is only one way to learn how to improvise:
listen, listen, listen, listen!!!
then...
emulate, emulate, emulate!!!
find some records of jazz guitarists that you love, then listen to the tracks until you puke, and try to copy them. i highly recommend starting with the blues because...