What is the source for the common practice of making a celebration (siyum) upon completing a tractate of Talmud or another significant amount of learning?
Talmud Shabbos 118b. When Abaye would see a student make a siyum on a masechta, he would make a celebration for the Rabbis.
The Midrash in Koheles Rabbah (1:1) makes the following statement, regarding the morning after King Solomon had his famous dream in which G-d promised him wisdom like nobody had ever had.
אָמַר רַבִּי יִצְחָק חֲלוֹם עוֹמֵד עַל כַּנּוֹ, צִפּוֹר מְצוֹיֵץ וְיוֹדֵעַ עַל מָה מְצוֹיֵץ, חֲמוֹר נוֹהֵק וְיוֹדֵעַ עַל מָה נוֹהֵק, מִיָּד (מלכים א ג, טו): וַיָּבוֹא יְרוּשָׁלָיִם וַיַּעֲמֹד לִפְנֵי [ארון ברית אדני ויעל עלות ויעש שלמים] וַיַּעַשׂ מִשְׁתֶּה לְכָל עֲבָדָיו, אָמַר רַבִּי יִצְחָק מִכָּאן שֶׁעוֹשִׂין סְעוּדָה לְגָמְרָהּ שֶׁל תּוֹרָה.
Says R' Yitzchak: The dream stood on its nest [i.e. it was immediately fulfilled]. A bird would chirp, and he would know about what it was chirping. A donkey would bray and he would know about what it was braying. Immediately (Kings 1:3:15) "he went to Jerusalem and he stood before the Ark of the Covenant of G-d, and he brought up Olos and made Shelamim, and he made a feast for all of his servants." Says R' Yitzchak, from here we learn that one makes a feast on completing the Torah.
An almost-identical Midrash appears in Shir HaShirim Rabbah 1:9, except that there, the final statement is attributed to R' Elazar, rather than R' Yitzchak.
This sentiment is paralleled in Shabbos 118b-119a:
ואמר אביי תיתי לי דכי חזינא צורבא מרבנן דשלים מסכתיה עבידנא יומא טבא לרבנן
Says Abaye: Give me my reward, for when I see a young sage finish a Masechta, I make a feast for the Rabbis.
The Rema quotes this as Halacha in Yoreh De'ah 246:26:
הַגָּה: כְּשֶׁמְּסַיֵּם מַסֶּכֶת, מִצְוָה לִשְׂמֹחַ וְלַעֲשׂוֹת סְעֻדָּה, וְנִקְרֵאת סְעֻדַּת מִצְוָה.
Rema: When one finishes a masechta, it is a mitzvah to rejoice and make a feast, and it is considered a feast of a Mitzvah.