Why did she say "this time I will thank Hashem"?
Rashi: Now she had [four, which is] more than her proper share of sons. 1
Hadar Zekenim, Moshav Zekenim #1: She saw that Resha'im would descend from Reuven (Dasan and Aviram), Shimon (Zimri) and Levi (Korach). She did not see any Resha'im from Yehudah 2 , rather, he will admit about Tamar!
Da'as Zekenim, Moshav Zekenim #2: She saw [through prophecy] that Yehudah will be Modeh (admit) about Tamar, so she was Modeh (thanked) Hashem.
Bechor Shor (34,35): Leah gave two shares of honor to Hashem, and one to her husband. She named two sons based on praise of Hashem, and the third relates to her connection to Yakov. For the fourth, she returned to name based on praise of Hashem.
Tosfos ha'Shalem (3): Yehudah was greater than the previous sons. Kohanim and Leviyim come from Levi, and kings from Yehudah.
Ohr ha'Chayim: Until now, Hashem did what was needed (gave her sons so her husband will love her and not hate her, and accompany her). This time is only due to Hashem's extreme goodness.
Malbim: This time, the son does not affect her connection to her husband, so she called it based on thanks to Hashem.
No one thanked Hashem before Leah (Brachos 7b). (Did the Avos not thank Hashem?! Adam said "Tov Lehodos la'Shem" (Tehilim 92:2)! Rather, her thanks was different. Everyone else felt that they received finite gifts from Hashem's unlimited ability to give. Leah was the first to feel that Hashem has a limit to what He can give (there will be only 12 Shevatim, from four wives), and He gave to her more than her proper share. - PF)
Moshav Zekenim: However, Achaz, Amon and other evil kings come from Yehudah!
Why does it say "she ceased to give birth"?
Bechor Shor: In each of the first four years, she had one child every year. The fifth year she did not give birth, in the sixth year was Yisachar, and in the seventh year were Zevulun and Dinah together. 1
Moshav Zekenim: This was a punishment for not thanking Hashem until now. 2
He holds that all 12 births in the seven years were nine month pregnancies, but 'new' mothers were already pregnant before the previous baby was born. (We must say that Yakov's marriages to Bilhah and Zilpah, and the sale of the Duda'im, were before the births of Yehudah, Naftoli and Asher, respectively; the Torah is out of order. Yehudah was born at the start of the fourth year.) According to Seder Olam Rabah (2), each pregnancy was for seven months after the previous birth, there could not be eight births in the last four years! (PF)
No one thanked Hashem before Leah (Brachos 7b). Why was only she punished? And why was she punished now, after she corrected her mistake?! We find like this - converts are punished after conversion, for not converting earlier (Yevamos 48b)! (PF)