The Yerushalmi (Megila 4:2) learns from the verse (Devarim 31:26) “Lakoah Et Sefer HaTorah Haze” (“Take this Torah”) that one should grasp onto the Sefer Torah while reciting its blessings, and this is codified in the Shulhan Aruch (Orah Haim 139:1). The Rama (ibid.) notes that another source for this is from Yehoshua bin Nun, of whom it says (Yehoshua 1:8) “Lo Yamush Sefer Haze Mipicha”, that the Torah shall never leave his mouth. Paranthetically, the continuation of this verse is also the source of the expressions associated with reading the Torah “Hazak Ve’Ematz”, “Hazak Ubaruch”, “Hazak Hazak Venithazek”, and in the Moroccan community, when one of the five books are completed, “Hizku Veametz Levavchem Kol Hameyahalim L’Hashem”.
Practically speaking, this is accomplished by holding onto the handles of the Torah scroll or the case in which it is set. Another method is to hold onto the parchment itself, but since touching the parchment is forbidden (Megila 32a), an intervening cover or cloth is used. This is why, especially in the Moroccan community, the entire scroll is wrapped in an underlying cloth, so that one not make contact with the actual parchment. The Arizal (Pri Etz Haim, Keriat Sefer Torah, ch. 2) writes that while reciting the blessing, one should hold the Torah with both hands, and should remove one’s left hand after the blessing and during the reading of the Torah. This, he explains, is so that the Attribute of Mercy, represented by the right hand, overpowers the Attribute of Judgement. The Ben Ish Hai (Shana Alef, Toledot, § 18) and others concur with this approach.
Summary: One should hold on to the Torah with both hands while reciting the blessing of the Torah, and should continue holding only with the right hand during the reading of the Torah.