The only way to really understand Gemara is to understand the people and places in it. There are several books on the Sages.
In Hebrew you have Shem HaGedolim of the Chida and Seder HaDorot in 3 volumes (vol 1; vol 2; vol 3). There are also Dorot HaRishonim in 7 volumes (vol 1; vol 2; vol 3; vol 4; vol 5; vol 6; vol 7) which was written partly as a refutation of Graetz (also in multiple volumes: vol 1; vol 2; vol 3; vol 4; vol 5; vol 6).
There is also Encyclopedia le-Chochmei HaTalmud by Reuven Margoliot (which is not available online as far as I know)
And Daat has a very good online resource of people from the Talmud.
The most recent (and possibly best) book on the subject is by Benyamin Lau (nephew of the former Chief Rabbi). It is 5 volumes in Hebrew, the first 2 of which have been translated into English: The Sages: The Second Temple Period; Character, Context & Creativity (Sages: Character, Context & Creativty)
There used to be a very good book called Who's Who in the Talmud
There are a few other books of Jewish history, but those are the main ones I can think of off the top of my head. Please feel free to add others in the comments.