I was taught that in the era immediately after the redaction of the Talmud, the Masoretes made what is now the final determination of which writings constituted the Tanach (for example, the book of Job is sacred writing, while the book of Judith is apocrypha). I was also taught that the Masorim determined the final "layout" of the Torah, that is, which words would have a break to the next line in the column, where there would be long or short gaps, what trup symbols were assigned to each word, and so forth. After that was the era of the Gaonim, and the great Rishonim (especially Rashi) leaned heavily on the work of the Gaonim (as well, of course, as the Talmud and the Midrach Rabbah).
Now I have heard of the Savorim, which came right after the Talmud was redacted and in fact some Savorim are mentioned in the Talmud. On Wikipedia, it is stated that the Gaonim came right after the Savorim.
In that case, where do the Masoretes (Masorim?) come in? And where does that name come from?
In response to a comment, I realized I mis-spoke -- the Masoretes codified the standard format (wordings etc.) of the Torah scroll and Tanach, but the selection of which writings constitute the Tanach was made at a much earlier time, probably before the Gemmorah started to be developed.