The Gemarah in Tannis (30b-31a) provides six reasons for the joy of Tu B'Av. Among the reasons given is that on Tu B'Av, they ceased chopping wood for the mizbeach. This is because, from that day onward, the sun was no longer strong enough to dry the wood, leaving insects in it. The Mishnah in Middos (2:5) teaches that any wood infested with insects is forbidden for use on the Mizbeach.
A question arises: Why does the stopping of wood chopping make Tu B'Av one of the most joyous days of the year?
The Rashbam (Bava Basra, 121a-b) explains that since they completed a mitzvah that took a significant amount of time, Tu B'Av became a day of celebration.
(Based on this Gemara and the Nimukei Yosef, the Rema (Y.D. 246:26) rules that we are joyous when completing a tractate and make a siyum because it's a mitzvah that takes a long time to complete.)
However, Rabbeinu Gershom explains the joy another way: since they finished chopping the wood, they had more time available to learn more Torah. Therefore, Tu B'Av is a joyous day.
Another connection of Tu B'Av to the Torah is what the Gemarah says right after that: From Tu B'Av onward, the days begin to shorten, and the nights lengthen. One who increases their Torah study during these longer nights will merit a lengthened life. The Rema (Y.D. 246:23) codifies this halacha, stating that from Tu B'Av onward, one should add to their nightly Torah learning.