The full Sephardic/Edot HaMizrach text of Keil Erekh Apayim is recorded in Siddur Edot HaMizrach (Weekday Shacharit, Torah Reading 2-4), giving two stanzas beginning אֶל אֶרֶךְ אַפַּיִם וְרַב חֶסֶד וֶאֱמֶת and אֶל אֶרֶךְ אַפַּיִם וּמַלֵּא רַחֲמִים, each closing with a cry for mercy on Israel and an appeal for forgiveness, and the Sefard-rite Torah reading order for Monday and Thursday is likewise flagged in Siddur Sefard (Torah Reading for Shabbat Mincha & Monday, Thursday 2).
The Ashkenazic custom, by contrast, places two Yehi Ratzon petitions before returning the Torah on the Mondays and Thursdays when Tachanun is said — one for the rebuilding of the Temple and the return of the Shechinah, and one for compassion upon the remnant of Israel and protection from destruction and plague — as recorded in Siddur Ashkenaz (Weekday Shacharit, Reading from Sefer, Raising the Torah 4-6).
Shulchan Arukh (Orach Chayim 134:1) establishes the broader framework behind this practice: the custom of multiplying supplications on Monday and Thursday and reciting Vehu Rachum aloud while standing, because these are days of divine favor, a point also tied by the Tur (Orach Chayim 134) to Moshe ascending on Thursday and descending on Monday with the second tablets, and reflected in the enumeration of weekday petitions in Seder Troyes 3:1.
Rav Eliezer Melamed (Peninei Halakhah, Prayer 22:3) distinguishes the two customs explicitly: Ashkenazim begin with Keil Erekh Apayim and do not say it on festive days such as Rosh Chodesh or Chanukah, while Sephardim recite their own version only on Shabbat and Yom Tov, with some also saying it on Rosh Chodesh.
Shulchan Arukh HaRav (Orach Chayim 429:12) likewise notes that Keil Erekh Apayim is said on Monday and Thursday throughout the month, but is omitted on Erev Pesach since that day, being Yom Tov itself, is unlike other erev Yom Tov days.
The phrase at the heart of this prayer draws on the divine attributes proclaimed to Moshe in Shemot 34:6 and echoed in Tehillim 145:8 and Bamidbar 14:18, and Rosh Hashanah 17b teaches that Hashem showed Moshe this very order of supplication, promising that whenever Israel sins and recites the thirteen attributes in this order, He forgives them — the theological basis for invoking Erech Apayim before the Torah is returned.
Related but distinct occasions also surface in these sources: Piskei HaSiddur (Festivals 3) addresses the recitation of the thirteen attributes before Torah reading on the three regalim when they fall on a weekday, and HaAgur (Laws of Tisha Be'Av 853) addresses the special case of Tisha Be'Av falling on a Monday or Thursday, where Rav Amram's practice of saying Keil Erekh Apayim together with Vehu Rachum is contrasted with the Spanish custom of omitting Keil Erekh Apayim entirely.