The Shelah (Sha'ar Ha-Osiyos, kuf, birkas ha-mazon) records the practice of reciting Psalm 137 (Al naharos Bavel) before reciting the grace after meals. However, this sad psalm is inappropriate for Shabbos or (even minor) holidays. Therefore, Psalm 126 (Shir ha-ma'alos) is recited instead. This practice is cited by the Magen Avraham (1:5) and some later posekim. Reciting Psalm 126 on Shabbos and holidays seems to be the normative Askenazic practice, although followers of the Vilna Gaon's customs do not recite it. It is unclear why, but reciting Psalm 137 on regular days seems to have largely fallen out of practice.
I have seen some add another three verses to Psalm 126 -- Psalms 145:21, 115:18, 107:1, 106:2. I tried looking for some explanation as to why these are recited. Based on whom I have seen reciting these extra verses, it struck me as possibly being a German custom. However, the Baer Avodas Yisrael siddur does not have these verses. Ta'amei Ha-Minhagim, Minhag Yisrael Torah and Prof. Sperber's Minhagei Yisrael do not discuss this at all. I tried (not too hard) looking for the original Shelah but could not find it. The only thing I could find is in the Otzar Ha-Tefillos siddur (Ashkenaz, vol. 1 p. 474), in which a brief introduction and 13 verses are listed as being a segulah (charm) for always having sufficient food if recited before the grace after meals. These are listed after Psalms 137 and 126, and the last two verses are among the four I've seen added. However, beyond that I've found nothing. It would seem that this practice evolved from some kabbalistic charm, but this practice is found among German- and modern-types who would normally avoid charms.
Online, I found this suggestion by R. Yehonatan Chipman:
From the Siddurim that I am familiar with, it seems clear to me that the original, classic Ashkenazi minhag is to recite Psalm 126 (Shir Hama'alot) alone on Shabbat and Yom Tov, etc., and Psalm 135 (Al Naharot Bavel) on weekdays. Thus in Baer's Avodat Yisrael (the classical Yekkishe Siddur, publsihed in the 19th century in Rodelheim), in the Gera's Ishei Yisrael, in Rav Kooks' Olat Re'iyah, and in many others. The classical Sephardi (Oriental) minhag, on the other hand -- what is widely known in Israel as Minhag Baghdad, as in Siddur Tefillat Yesharim, in the various siddurim of Rav OvadiahYosef and Rav Mordechai Eliyahu, etc -- has no psalms before Birkat Hamazon, but does have five verses, recited both weekday and Shabbat: Ps 34:1; Kohelet 12:13; Ps 145:21; 116:18 (the last two are "tehilat hashem.... va'anahnu nevarekh Kah...); and Ezek 41:22b (i.e, the second half of that verse only).
Somewhere along the way -- essentially, after the development of Hasidut and its adaptation of Kabbalat ha-Ari and its nusah-- there began to develop hybrid nushaot, which collated elements of Ashkenaz and Sefarad (i.e, the so-called Nusah Sefarad of the Hasidim, whch in many cases overlaps or conflates both readings). Thus, the Habad Siddur adds these five verses followig Shir Hamaalot/Al Naharot Bavel, as the acse may be, also adding Psalm 87, as well as Job 20:29 just before mayim
aharonim (Vayedaber ailay is said afterwards).
The custom I have seen today in many homes is a perhaps a variation on that: to say Shir Hama'alaot, followed by "Tehilat hashem... Vaanahnu..." (i.e., Ps 145:21 and 116:18). Some people add only these two verses, while others add Ps 118:1 (=106:1) and 106:2 as well (Hodo la-Shem... Mi yimalel). My personal theory is that these last two verses may have been added for musical reasons: in most melodies for
Shir hama'alot, from Yossele Rosenblatt's on down, the melody is repeated twice to accomodate the text (vv. 1-3, then vv. 4-6). If one adds two verses, one sings it a third time, but is stuck in th emiddle, so two more verses are needed to round out the third round.