What was the reason why Ruth converted to Judaism? Was it love of Naomi or love of Hashem or both?
An answer can possibly be cited from Yevamos 47b:
אמר רבי אלעזר מאי קראה דכתיב (רות א, יח) ותרא כי מתאמצת היא ללכת אתה ותחדל לדבר אליה
Rabbi Elazar said: What is the verse from which this ruling is derived? As it is written: “And when she saw that she was steadfastly minded to go with her, she left off speaking with her” (Ruth 1:18). (Sefaria Translation)
The Gemara understands this to mean that when Naomi set out to return to Eretz Yisrael and Ruth insisted on joining her, this was when Ruth wished to convert. Naomi attempted to dissuade her, but Ruth persisted. The verse states that once Naomi saw Ruth’s resolve to convert, she desisted from her attempts to dissuade her.
This is reinforced in the Midrash - Rus Rabbah (2:22):
וַתֹּאמֶר רוּת אַל תִּפְגְּעִי בִי לְעָזְבֵךְ לָשׁוּב מֵאַחֲרָיִךְ (רות א, טז), מַהוּ אַל תִּפְגְּעִי בִי, אָמְרָה לָהּ לֹא תֶחֱטָא עָלַי, לָא תִסְּבִין פְּגָעַיִךְ מִנִּי, לְעָזְבֵךְ לָשׁוּב מֵאַחֲרָיִךְ, מִכָּל מָקוֹם דַּעְתִּי לְהִתְגַּיֵּר, אֶלָּא מוּטָב עַל יָדֵךְ וְלֹא עַל יְדֵי אַחֶרֶת. כֵּיוָן שֶׁשָּׁמְעָה נָעֳמִי כָּךְ הִתְחִילָה סוֹדֶרֶת לָהּ הִלְכוֹת גֵּרִים, אָמְרָה לָהּ בִּתִּי אֵין דַּרְכָּן שֶׁל בְּנוֹת יִשְׂרָאֵל לֵילֵךְ לְבָתֵּי תֵּיאַטְרָאוֹת וּלְבָתֵּי קִרְקָסִיאוֹת שֶׁל גּוֹיִם. אָמְרָה לָהּ, אֶל אֲשֶׁר תֵּלְכִי אֵלֵךְ. אָמְרָה לָהּ בִּתִּי אֵין דַּרְכָּן שֶׁל יִשְׂרָאֵל לָדוּר בְּבַיִת שֶׁאֵין שָׁם מְזוּזָה. אָמְרָה לָהּ, בַּאֲשֶׁר תָּלִינִי אָלִין עַמֵּךְ עַמִּי, אֵלּוּ עֳנָשִׁין וְאַזְהָרוֹת. וֵאלֹהַיִךְ אֱלֹהָי, שְׁאָר מִצְווֹת.
"And Ruth said: entreat me not to leave you and to return from following you (Ruth 1:16)"-- what does "entreat" [lit. "hurt"] mean? Ruth said to Naomi, "Do not sin against me by telling me to leave and return from following you. I intend to convert anyway, and it is better that I do it with you than with someone else." When Naomi heard this, she immediately began to lay out before her the laws of conversion. Naomi said, "My daughter, Jewish women do not go to the non-Jews' theaters and circuses." Ruth said, "Where you go, I will go." Naomi said, "My daughter, Jewish women do not live in a house where there is no mezuzah." Ruth said, "Where you lodge, I will lodge." "Your people shall be my people," refers to warning and punishment, and "Your God shall be my God" refers to the rest of the commandments."
So to answer your question, it would seem that arguably Ruth had gained a great sense of closeness to her mother-in-law which must have in some way conceivably made her committed to not only following her, but also converting. As a princess growing up in the courts of Moav, she knew that she would be entering Eretz Yisroel as an not only an outsider, but a member of a nation that was a proven enemy of the Jewish people! Yet we see, that despite Naomi's exhortations to leave, Ruth had resolved to live in this new reality. To the point where the Malbim, Alshich and Chesed LeMishicho on Rus 1:15-16 all point to the fact the Ruth felt that separating from Naomi and by extension the Torah, was like separating from life itself!
While many believe Ruth converted when she said in 1:16, that “your G-d is my G-d,” Gersonides, also known as Ralbag interpreted chapter 1 to be saying that Orpah and Ruth converted to Judaism prior to marrying Mahlon and Chilion, and the proof is that her conversion is not mentioned for Boaz. Naomi even later tested them to see if they have converted. Thus, it seems that Ruth converted out of love of G-d.
On the other hand, Ruth said “Your G-d is my G-d” because Naomi said: “Look, your sister-in-law returned to her people and her god; you should return after your sister-in-law.” Ruth answered: “No, I will go where you go and your G-d will be my G-d.” This is another way of saying, “Your land will be my land.” This seems to say that she did it for her love for Naomi.
Tradition says she converted for love of Hashem. But one is allowed to ask: Why didn't she do it before, when she was married to a Jew for 20 years? Also, let us look at her actual words:
And Ruth said [to Naomi], Do not entreat me to leave you, or to keep from following you; for wherever you go, I will go; and where you lodge, I will lodge; your people shall be my people, and your God my God; Where you die, will I die, and there will I be buried; the Lord do so to me, and more also, if even death parts me from you. (Ruth 1:16-17)
She does not speak of her love of God, of Israel, of Judaism, or of monotheism. She speaks only of her love of Naomi. (This point is attributed to Rabbi Samuel ben Isaac de Uçeda of 16th-century Tzfat, Israel, in his commentary on the Book of Ruth, Iggeret Shmuel.)