I have learned the concept of major and minor chords (as they are played on piano). However, when I look at how the chords are played on guitar, I see that 4 tones are involved instead of 3.
Major and minor chords each contain 3 distinct notes (distinct letters). So a C major chord always contains C, E, and G.
However, the chord can be voiced as you like, with one or more instances of each of those notes spread over the range of the instrument. That's equally true on guitar and piano - there's no difference in what a 'chord' means on each of those instruments, although of course different voicings may sound better, or be easier to play, on different instruments.
So, my question is what is the rule for determining the bass tone?
Simplistically speaking, you choose one of the notes from the chord - which one you choose will affect what inversion of the chord you are playing, but it won't change the name of the chord. Usually you'll choose the bass note (and thereby inversion) for each chord such that the overall result sounds best to you, within the limits of what's practical to play.
If you want to be 'cleverer', you could play a pattern involving two or more of the tones in the chord, and you might even play a bassline that strays outside the notes in the chord, e.g. using a passing note.