One of the fundamental ways of thinking about chords involves "stacking thirds". From a scale perspective this means taking every other note in the scale. To build a CMaj7 chord, start with a C Major scale, or more specifically, start with the C Ionian mode, and take every other note: C-E-G-B. You can continue into the next octave to get the chord extensions (9th, 11th, and 13th): C-E-G-B-D-F-A. That chord is a CMaj13.
You can build a G7 chord in the same way, but starting from the 5th degree of the C Major scale, i.e. the G Mixolydian mode. G-B-D-F. To get the chord extensions, continue into the next octave: G-B-D-F-A-C-E. That is a G13, and contains the 9th, 11th, and 13th. Note that a chord symbol with a 9, 11, or 13 implicitly contains the lower extensions.
Yet, those implicit extensions may be left out in practice. For example, it is especially common on guitar to see 13th chords spelled with only the root, 3rd, 7th, and 13th. A G13 spelled this way is G-B-F-E, and a common shape for this is:
In jazz we often play chord fragments instead of full chords. This has a lot of implications; it allows more space for soloists when you are comping, it allows more freedom when you are playing solo and chord melody pieces, it can provide nice ambiguities when multiple chords may be implied, and sometimes it can provide a nice texture. To do this, it is often best to think of chords as the notes that you want to include rather than a big collection of notes from a scale. You might need a C9 chord; you could play C-E-Bb-D-G:
This is a common shape for C9 that includes all of the notes, but the 5th is not too important to the sound of the chord. The 3rd establishes whether the chord is major or minor, the 7th establishes whether the chord is a major or dominant 7th chord, and the 9th is an extension. In some ways the 9th is the most important note in a 9th chord, so in some cases you might just play the root and the 9th, or add the 7th if you want, or the 3rd and the 7th. If you want a more open sound on a C9 you could try:
This chord contains only the root, 7th, and 9th of a C9. With no 3rd, it is ambiguous: it could be a C9, or it could be a Cm9. Here is a very ambiguous chord that I sometimes use in place of a C7(b9):
This isn't even really a chord by itself, containing only the root (doubled) and the b9. But it is an effective sound to use at times.
Summing up, learn the basics of how chords are constructed, i.e. by stacking 3rds (know that you can also stack 4ths or 5ths for other chord types). Learn which notes are important in chords, and build the chords that you need. There is a correct way to spell a C7(b9) chord in theory (C-E-G-Bb-Db), and while there are incorrect ways, there is no one correct way to spell C7(b9) in practice.