I'm going to assume the opposite of the previous poster (couple back), and say that you aren't referring to play 10 minute solos during Brown Eyed Girl in a cover band. If you're playing in a rock band, by all means limit your creativity to fulfilling the requirements of the gig while on the gig.
But it is also important (to me, and apparently to the OP too, or they wouldn't be asking) to allow yourself some time to play freely. Improvise completely, with no preconceptions of sounding good or tasteful or impressive. Do this alone or with musicians you trust that are interested in exploring with you. Try to play what you hear in your minds ear, without planning too far ahead, just like you do when having a conversation with a close friend. When you start doing this, don't record; let the experience be what it is without going back to critique. When you feel comfortable and loose, eventually record and see what is there.
One technical skill you need besides knowing scales, modes, and chords is ear training. You need to know what all of the intervals sound like before you play them. There are some tricks an if you google a bit you can find them, I'm sure. The theme from Jaws is a half step, "here comes the bride" is a perfect fourth. Sing along with your improvising and scales, etc to cement these relationships in your ear.