Based on a Pasuk, Gittin 60b tells us ”Dvarim SheBichtav Ei Atta Rashei LeOmeran Al Peh” meaning that Torah which is written should not be said be heart. The rishonim introduce many leniencies for this law and the achronim are of different opinions as to whether one should be strict regarding this issue or lenient. This prohibition is brought in Shulchan Aruch in the laws of Pesukei DeZimrah, where this law is a practical issue.
Saying Pesukim by Heart
Pesukim that are Familiar
- Even though there is a halacha that Torah SheBechtav (the written Torah, which includes Torah, Neviyim, and Ketuvim) should not be said by heart it is permitted to say “Kriyat Shema”, “Parshat Birkat Cohanim”, and “Pesukei DeZimrah” as well as all pesukim in tefillah because people are commonly fluent in them. But pesukim that people are not fluent in and familiar with, one may not say by heart. 
- If the one saying the pesukim is fluent in them but most people are not, one should not say it by heart. However if it is impossible in another fashion and one will lose out on one's Torah learning one can be lenient. 
- Those who say a pasuk which begins with the first letter of one's name and ends with the last letter of one's name has on what to rely to recite it by heart. 
- Those who say “Kadesh Li” and “VaHaya Ki Viyecha” after putting on Tefillin everyday can say these pesukim by heart. But if there is no minhag in that place to say it daily one should be strict not to say it by heart. 
Fulfilling Others' Obligation
- If one is fulfilling the obligation of others even if everyone is fluent in the pesukim one should not recite them by heart unless it is impossible to read them from writing.
- When one is fulfilling the obligation of others, one should be strict not to say these pesukim by heart even if everyone is familiar and knows these pesukim by heart. Therefore, one should be careful to say Vaychulu of Kiddish and any other pesukim said during Kiddish (or Havdalah) from a Siddur so that one does not say pesukim by heart in order to fulfill the obligation of others. However, some defend the minhag.
- A blind person is allowed to say pesukim by heart since he does not have another way to read the pesukim. 
- A Rabbi giving a Dvar Torah quoting many pesukim and it is therefore difficult to read all of them from a sefer has what to rely on to say them by heart. 
- The minhag to teach children pesukim by heart in school has what to rely on. 
- The Targum (translation) of Torah Shebiketav can be said by heart. 
- Saying Torah Shebiksav Writing Torah Shebal Peh by Rabbi Elly Storch
- Article on Reciting Prayers by Heart by Rabbi Ari Enkin
- Sefer Siftei Shoshanim on Hebrewbooks.org
- Rav Yehuda is recorded in the Gemara Gittin 60b and Temurah 14b as saying that the written Torah should not be said orally and the Oral Torah should not be written. He bases this off the pasuk ויאמר ה אֶל מֹשֶׁה כְּתָב לְךָ אֶת הַדְּבָרִים הָאֵלֶּה כִּי עַל פִּי הַדְּבָרִים הָאֵלֶּה כָּרַתִּי אִתְּךָ בְּרִית וְאֶת יִשְׂרָאֵל (Shemot 34:27). Rambam (Tefilah 12:8), Tur and Shulchan Aruch 49:1 codify this prohibition as halacha. Tosfot Yeshanim (Yoma 70a s.v. UbeOser)writes that Rav Yehuda’s rule is only a more proper way to do the mitzvah and not mandatory. However Yerushalmi (Megilah 4:1) imply it is a true prohibition and Petach Aynayim (Yoma 70a) writes that the rishonim write as if it is a real prohibition meaning that they disagree with the idea of the Tosfot Yeshanim 70a s.v. ub'esor who says it is only an enhancement of the mitzvah of Kriyat HaTorah. Tashbetz 1:2 says that this is a torah prohibition and Chatam Sofer OC 38 agrees. On the other hand, Yereim 268 says that it is only rabbinic. Birkei Yosef 49:2 proves from Mordechai Megillah n. 792-3 that it is only a rabbinic prohibition.
- Tosafot Ri"d Megilla 17a says that this prohibition exists because one who recites pesukim by heart might make a mistake.
- Ritva Gittin 60b "Ha Keitzad" says that since there are times when the torah has letters that aren't pronounced and the rabbis derive laws from those, they will be missing if recited by heart.
- Raavan teshuva 42 says the prohibition exists so as not to disgrace Sifrei Torah.
- See also Yereim 268, Maharal Tiferet Yisrael 58, and Minchat Asher Parashat Ki Tisa for a longer discussion.
- Kitzur Shulchan Aruch 1:6. Tosafot Temura 14b brings one suggestion that the prohibition only applies to torah but not neviim and ketuvim. However, Rabbenu Gershom Temura 14b says explicitly that it applies to torah, neviim, and ketuvim.
- Shulchan Aruch 49 permits Kriyat Shema, Parshat Birkat Cohanim and Parshat HaTamid because everyone is fluent in these pesukim. In the rishonim there are many explanations as to why it is permitted to say Mizmorim and Pesukim in prayer by heart (here are only 6 approaches all of which Bet Yosef quotes). Bet Yosef quotes the (1) Mordechai (Gittin 407) who writes that anything that everyone is fluent is permitted. So writes Tosfot Rid (Tanit 28a), Or Zaruh 1:545, and Sh”t Maharam (Prague Edition 313). Bet Yosef also quotes (2)Tosfot (Temurah 14b D”H Devarim) who says that there is only a prohibition by Torah and not Nach. So writes Bach 49. However, Rabbenu Gershom (Terumah 14b) holds it applies to all of Tanach. Similarly, Tosfot Rid (Mehudra Batra Megilah 17b), Smag (Megilah), Or Zaruh 1:378, Mordechai (Megilah 793) and Tosfot (Bava Kama 3b s.v. Kedemetargem Rav Yosef) all imply that it applies to all of Tanach because they deal with the issue in context of pesukim in Nach. (3)Tosfot (Temurah 14b) adds that any reading that is not to fulfill the obligation of others is permitted. So writes Tosfot Yeshanim (Yoma 70a), Yerayim 128, Sh”t Maharam (Lulav edition 437), Smag (megilah), Tashbetz 185, and Kol Bo 13. Rav Shlomo Bamburger in HaMeayen (Tishrei 5737) writes that those who hold that one may not fulfill the obligation of others only applies if one fulfills the obligation of many others, but for one other person it is totally permissible. However, Shemirat Shabbat KeHilchata (chapter 47 note 142) questions this חידוש. See also Minchat Asher (Ki Tisa pg 415-6).(4) Bet Yosef then quotes the Kol Bo 13 in name of Yerushalmi(Yoma 7:1) that it only applies to Torah reading and not tefillah. This is also the opinion of the Orchot Chaim (Meah Brachot 14), Rabbenu David Avudraham (Shachrit Shel Chol pg 48), and Rambam (Tefilah 12:8) where he only quotes this prohibition in the context of Torah reading. However Radvaz 4:1205 writes that we do not hold like this Yerushalmi. (5)Kol Bo continues that it does not apply to when pesukim are read without the Torah reading tune. This is also the opinion of Ritva (Yoma 70a),Tosfot Shantz (Terumah 14b), and Radvaz 4:1205. Bet Yosef also quotes (6)Talmidei Rabbenu Yonah (Brachot 5a) who say any pasuk that one is obligated to say can be said by heart. So writes Sefer Charedim (2 Mitzvot Aseh Min HaTorah HaTeluyot BeAynayim). The Siftei Shoshanim 2 and Halacha Brurah 49:1 quote at least another 4 approaches in the rishonim. There are two approaches in the achronim on how to deal with all the leniencies. Magen Avraham 49:1 writes that one should not say pesukim by heart except with the leniency brought by Shulchan Aruch and nothing else. So writes Bear Hetiev 49:1, Tahart HaMayim (Shurei Tahara 4:36), Shedei Chemed (Marechet Chalitzah 33), Sh”t Torah Lishma 197, and Halacha Brurah 49:1. Similarly, Mishna Brurah 49:6 quotes the Magen Avraham and then adds but one can rely on the Chovot Yair to say Tehilim by heart which are prayers because of the opinion of the Atret Zekenim and Gra. However Aruch HaShulchan 49:3 holds by many of the leniencies and concludes “one does not have to be strict because of the Gedolim we can rely on and I do not know why some were very strict in this matter (Magen Avraham)”. Similarly, Sh”t Tzitz Eliezer 13:11 says that the leniencies are not contradictory.
- Shulchan Aruch 49 based on Tur in name of Rabbenu Chaim rules that one can be lenient if all people are fluent with those pesukim. Bach explains that it means that only the one saying the pasuk needs to be fluent in the pesukim. This is also the opinion of Birkei Yosef 49:4, Erech HaShulchan 49, Mamer Mordechai 49:2, Petach Dvir 49:2, Shlamei Tzibbor (Tefilah 6), Minchat Aharon9:12, and Sh”t Torah Lishma 197. However Magen Avraham argues that everyone needs to know the pesukim in order to recite them by heart. This is also the opinion of Sh”t Shalit Yavetz 1:75, Bear Hetiev 49:1, Shulchan Aruch HaRav 49:1, Derech Chaim (Hashkamat Boker 20), Kitzur Shulchan Aruch 1:6, Chesed LeAlafim 49:1, and Mishna Brurah 49:4. Kaf HaChaim 49:2 and Halacha Brurah 49:1 says if there is no other way one should not lose out on Torah learning because of this.
- Although, Sh"t Hitorirut Teshuva 1:227 questions this practice, Yalkut Yosef Kitzur S"A 49:12 writes that those who do so have on what to rely.
- Halacha Brurah 49:3, Yalkut Yosef Kitzur S"A 49:13
- Pri Chadash 49 and Halacha Brurah 49:1 say that since Shulchan Aruch does not rule Tosfot’s approach (that it is only forbidden when fulfilling someone else’s obligation. This is from Tosafot Temura 14b) and does rule like the Mordechai’s approach (that it is permitted when everyone is fluent in it) one can be lenient if everyone is fluent in it even in case where one fulfills the obligation of others. However, Eliyah Raba 49:2, Chesed LeAlafim 49:1, Mishna Brurah 49:7 argue that because of the many rishonim and achronim who hold like Tosfot one should be strict any time one is fulfilling the obligation of others. Kaf HaChaim 49:8 says one should be strict if he can. Gra 49:2 holds like Tosfot and Magen Avraham 49:1 is concerned for Tosfot.
- Mishna Brurah 49:6 in name of the Magen Avraham and Buir HaGra.
- Shemirat Shabbat KeHilchata (chapter 47 halacha 31) is strict based on Mishna Brurah. However, Tzitz Eliezer 17:63, Minchat Asher (Parshat Ki Tisa pg 418), and Otzar Halacha (Siman 49 note 16) defend the minhag by saying that some (Kaf HaChaim 49:8) hold that one can be lenient to say pesukim by heart even in order to fulfill the obligation of others if everyone is familiar with these pesukim.
- Tosfot (Bava Kama 3b s.v. Kedemargem Rav Yosef), Shitah Mekubeset 3b in name of Rabbenu Yishaya, Sefer Agudah in name of Ri are lenient to allow a blind person to say pesukim by heart. However Or Zaruh 1:545,2:375, Ritva (Yoma 70a), Meiri (Megilah 24a) are strict in this regard. Magen Avraham 49, Sh”t Halachot Ketanot 1:217, Bear Hetiev 49:1, Solet Belulah 49, Derech Chaim (Hashkamat Haboker 20), Sh”t Teshuva MeAhava 2:242, Kitzur Shulchan Aruch 1:6, Shulchan Aruch HaRav 49:1, Kaf HaChaim 49:5, Yalkut Yosef Kitzur S"A 49:12 and Mishna Brurah 49:1 rule leniently like Tosfot.
- Mishna Brurah 49:6 and Yalkut Yosef (Pesukei DeZimrah 49:7, She'erit Yosef 2 pg 16), Yalkut Yosef Kitzur S"A 49:7
- Tzitz Eliezer 13:11 writes that the minhag for children to learn pesukim by heart in class has a reliable source in halacha (based on those who hold like the Rosh that if one is not fulfilling the obligation of others it is permissible, see there). Yalkut Yosef Kitzur S"A 49:8 agrees
- Birkei Yosef 49:1, Sharei Teshuva 49:1, Machzik Beracha 49:4, Kaf Hachaim 49:3, Yalkut Yosef Kitzur S"A 49:14