In the early days, many musicians did not have any theoretical knowledge of chords or scales or even keys! So they learned to play by ear; by listening, playing as much as possible and, by trial and error, they learned what sounded good. These days, many academically trained musicians know a great deal about theory but often fail to realize that they still have to learn to hear! No one can really tell you what sounds good; at least, what they say doesn't mean anything until you hear it yourself!
The study of theory is a time-saver because it allows a player to use his or her understanding of relationships to narrow down the choices of what will probably sound good. For example, if you know that a Dorian scale sounds good with a minor chord and you know what notes are in that scale, you can improvise with more confidence over the chord because you don't have to rely only on your ear. In other words, to some extent, you can play any note in that scale and know that it will at least sound okay. But, you still have to learn to hear that Dorian scale and know exactly how each note in the scale feels (sounds) to you to be able to really express your musical emotions.
Jerry Coker summed it up nicely in his "Improvising Jazz" book with a statement that said improvisation is a balance of emotion (hearing, feeling) and intellect (knowledge). The study of theory helps save an aspiring player time by showing the relationships in music that are normal and logical. But always remember, music is sound and therefore must be heard!