Select by color is supposed to select all occurrences of the color beneath the cursor - and those within the threshold you have set in the tool options - inside the whole image.
You can achieve your goal via two ways, depending on the desired result:
1. Change of tools
If you plan to end up with one contiguous selected region, then your task is more suited for the fuzzy selection tool (aka magic wand aka contiguous region selection).
This does also take the color from beneath the cursor location as a starting point, but also starts selecting from that location into the surrounding area. You can imagine this as if the selection would grow outwards from that initial point into the connected regions of reasonably similar colors.
See http://docs.gimp.org/en/gimp-tool-fuzzy-select.html for details.
2. Change of tool modes
This works nice if you want to get multiple, disconnected selected regions areas of similar color, but only within a specific part of your image.
You'll change the selection mode - that is one of Replace (the default), Add, Subtract and Intersect for the selection tools, and their purpose is to make the selection you are creating to replace, add to, subtract from or intersect with an already existing selection. The mode setting is found in the selection tool options.
So, in order to achieve this:
- create a selection with the Free Select tool in Replace mode
- switch to the Select by Color tool and set its mode to Intersect
- within the existing selection, use the tool to select a region with the colors you want; this may result in multiple selected regions
Note that the Intersect mode makes those only appear within the previously created selection, and nowhere else in the image.