I'd recommend checking out some basic theory material, Joe Hubbard and Scott Devine have some great stuff if you don't mind paying to access it but there's a ton of free stuff on the web too.
Very simply each degree of the scale has an associated chord to it, these are major, minor or diminished (ignoring the 7 for now).
For the C major scale this is how the chords line up, the chord number to major / minor relationship is true for any key, only the note values change.
I Chord - C - is major
Ii Chord - D - is minor
III Chord - E - is minor
IV Chord - F - is Major
V Chord - G - is Major
Vi Chord A - is minor
ViI Chord B - is diminished
You could play the C major scale over these chords and it will (mostly) sound fine, but in the same way a rhythm guitarist or keyboardist plays chords as bass players we need to do the same. As the bridge between harmony and rhythm our job is to outline the chord progression by playing the chord tones / arpeggios - this is especially true with jazz where you could well be asked to play walking bass lines.
Do.some research on intervals and chord tones, those concrpts should really help you understand this. Also since you seem to be into Jazz Learning Walking Bass is a great way to really understand this and where it all sits on the fretboard, or so I'm told. I'm still trying to perfect it myself.