Improvisation requires knowing, and I mean
knowing;
1. The melody - The first and most important thing is to know the melody. The melody is what people sing and what is tattooed on people's brains for decades.
yesterday... all my troubles seemed so far away. A solo that relates to the melody will be more easily digestible to the audience.
2. The chord changes and how the melody relates to the chords that are being played underneath. What generally sounds good is a solo (or melody) that flows bar to bar in a logical, mellifluous way, connecting the chords. Listen to the song "Misty" by Erroll Garner. This one played by the man himself:
Try to hear the melody and chords working separately, yet together, to create a sound that is absolutely beautiful.
3. Once you have those down, learn and internalize the scales that sound well with their respective chords, especially dominant scales.
There are only 3 functions of a chord/scale: major, minor, and dominant. Dominant chords/scales also include diminished and augmented chords/scales. If you know how these chords/scales work together to produce and resolve tension, your audience will never be bored.
There are many books on these concepts but my bible for the last eight years has been Mark Levine's THE JAZZ THEORY BOOK. From the beginning it will take you from the basics to the heights of improvisational creativity in an easy to understand way.