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
- 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 it. 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 loose out on one's Torah learning one can be lenient. 
- 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. 
- A blind person is allowed to say pesukim by heart since he does not have another way to read the pesukim. 
- 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. 
- 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. 
- 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 Vayichulu 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. 
- The minhag to teach children pesukim by heart in school has what to rely on. 
- Kitzur Shulchan Aruch 1:6
- Rav Yehuda is recorded in the Gemara Gittin 60b and Terumah 14b as saying that the written Torah should not be said orally and the Oral Torah should not be written. Rambam (Tefilah 12:8), Tur and Shulchan Aruch 49:1 codify this prohibition as halacha. Tosfot Yeshanim (Yoma 70a s.v. UbeOser) in his first answer to why on Yom Kippur the Kohen Gadol was allowed to read in the Bet HaMikdash a portion of Torah by heart writes that Rav Yehuda’s rule is only a more proper way to do the mitzvah and not mandatory. However Trumah 14b and Yerushalmi (Megilah 4:1) imply it is a true prohibition and so Torat Chaim Sofer 49:1 says that the Tosfot Yeshanim meant that it is only prohibited MeDerabbanan and not MeDeoritta. 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.
- 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 loose out on Torah learning because of this.
- 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) and does rule like the Mordechai’s approach (that it is permitted when everyone’s 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 strict if one can.
- 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, and Mishna Brurah 49:1 rule leniently like Tosfot.
- Halacha Brurah 49:3
- Mishna Brurah 49:6 and Yalkut Yosef (Pesukei DeZimrah 49:7, Sharit Yosef 2 pg 16)
- 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.
- 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).