I can answer about Bach on piano, but I think the ideas should apply on guitar.
In a lot of Bach's music imitative counterpoint is important. When the musical subject gets stated and re-stated in imitation as the music progresses I'm aware of those entries and I use that understanding to articulate the music and bring out the subject. The articulation could take many forms, but that isn't important as far as your question is concerned. The important thing is having the theoretical understanding of the music to recognize the subject and its imitation and then exploiting it to shape the performance.
Another very important application of theory would be identifying cadences or temporary key changes and using that to execute good phrasing. Again the exact execution could be handled many different ways - perhaps a little ritard is applied at cadences to articulate the phrase endings - the important thing is the theoretical knowledge about cadences and phrasing needed to understand the music structure and using that to render a good performance.
I also pay attention to scale degrees and the counterpoint interaction of bass and melody at important harmonic points. For example, if a
V7 resolves to
I I pay attention to the FA to MI (^4 to ^3) resolution. If a tonic chord is in first inversion
I6 to pay attention to which chord tone is in the melody. Maybe I don't do anything with this performance-wise, but I stay aware of these important harmonic tones. Probably it is a memory aid as it focuses on the essential musical framework.
Those would be some examples of a direct linking of theory to a good performance. Other things may come up that don't seem as essential and don't receive much conscious thought. Like a harmonic sequence. I notice the sequence. That's structurally important. But maybe I don't dwell on the exact chord names of each sequenced event. I care more about where it ends in terms of key.
Don't mistake that for indifference or not analyzing the music at all. Generally, I try analyzing everything I play with Roman numerals (unless such analysis doesn't make sense of the harmonic style.) But while actually playing I don't necessarily think about every single chord name.
One other theory thing I do all the time is look for real examples of music that breaks so-called theory rules! I think some people make too big a deal about rules so I like having examples to the contrary. I circle and write details such examples in my scores.
How much theory...?
I'm not sure how you would quantify it. But you probably aren't literally asking 'how much' for a quantity. I imagine it's more about what theory and why it matters in performance.