First of all, Rema adds in Orach Chayim 490:9 that we read Ruth on Shavuot. Here Magen Avraham quotes Yalkut Shimoni on Ruth (596 at the end):
מה ענין רות אצל עצרת, שנקראת בזמן מתן תורה? ללמדך שלא נתנה תורה, אלא על ידי יסורין ועוני וכו'
What is the connection between Ruth and Atzeret, so that it is read on Atzeret, the time of the giving of the Torah? To teach you that the Torah is only given through suffering and poverty.
Translation from this great article by Zvi Ron, kindly suggested by DoubleAA
This is in turn comes from the beginning of Ruth Zuta, an earlier midrash. However, the most practical reason is that the story takes place around wheat harvest (Ruth 2:23 and Machzor Vitry), and Shavuot was the festival of this agricultural event.
Many other interesting things are listed on this Chabad site:
The last verses show (Ruth 4:17), how King David descended from Ruth. Yerushalmi Chagigah 2:3 says in the gemara of the third halakhah that he died on Shavuot (א"ר יוסי בי רבי בון דוד מת בעצרת), and we know from the case of Moses that the most righteous people's years are completed, and they die on the day, when they were born (Rosh Hashanah 11a, Kiddushin 38a). So we read the Book of Ruth in King David's honour (Bekhor Shor to Bava Batra 14b).
The numerical value of Ruth's name is 606 (תר"ו). This alludes to the 606 additional laws that we received at Sinai in addition to the 7 Noachide laws. Ruth accepted upon herself these mitzvot as well when she converted (Birkei Yosef 494:11, see again Bava Batra 14b for a different explanation).
Ruth's case shows us, how important is the Oral Law that we also received on Shavuot. From Devarim 23:4 we may mistakenly infer that Amonites and Moabites can't marry Jews at all. However, Yevamot 69a makes it clear that it only refers to males and not to women (דאמר מר עמוני ולא עמונית מואבי ולא מואבית).
Although not everyone necessarily accepts teachings based on juxtaposition of verses (Berakhot 21b), it is quite thoughtful that after discussing the laws of Shavuot (Vayikra 23:15–21), the Torah tells us the laws of peah (Vayikra 23:22), a mitzvah that was fulfilled eminently by Boaz (Levush Hachur 494:2).
Sources again from Zvi Ron's article