The Ben Ish Hai (Rav Yosef Haim of Baghdad, 1833-1909), in Parashat Pinhas (Shana Sheniya, 16), writes that one should not wear shoes while sleeping. This is mentioned also by Rav Yaakob Haim Sofer (Baghdad-Israel, 1870-1939), in his work Kaf Ha’haim (Yore De’a 116:211). The reason is that by sleeping with shoes on, one "experiences the taste of death," Heaven forbid, and although we do not know precisely to what this refers, it is certainly something that we wish to avoid. Furthermore, the Kaf Ha’haim cites authorities who assert that sleeping while wearing shoes can adversely affect one’s memory. Therefore, before going to sleep one must ensure to remove his shoes.
Rav Haim Kanievsky (contemporary) writes that this applies to children, as well. Parents must ensure that their children’s shoes are removed when the children sleep. Even if the child is still very young and has yet to reach the age of Misva training, he or she should not sleep with shoes because this may affect the memory.
This Halacha applies to all kinds of shoes, including sandals and slippers.
There is considerable discussion among the authorities as to whether this applies only to a regular, full sleep, or even to a short nap. It is questionable whether one may keep his shoes on if he sleeps for a period that is shorter than "Shitin Nimin" (literally, "sixty breaths"). Furthermore, many different views exist in defining the term "Shitin Nimin." The Shaareh Teshuba commentary to Orah Haim (4) cites the work Tiferet Sevi as interpreting this term as referring to less than three hours. The Hid"a (Rav Haim Yosef David Azulai, 1724-1806), in his work Mahazik Beracha, writes that this period is slightly longer than a half-hour, whereas Rav Meir Azarya de Fano (Italy, 1548-1620) claimed that "Shitin Nimin" is just 3 and 1/3rd minutes. In light of these controversies, it is uncertain whether this Halacha of removing one’s shoes before sleeping applies when a person naps on a train, in a car, or on the couch for a short while.
What is clear, however, is that before a person goes to sleep he should remove his shoes, and should also ensure that his children’s shoes are removed before they go to sleep.
Summary: One should not have shoes on while sleeping, and children’s shoes, too, should be removed before they go to sleep. It is unclear whether this Halacha applies to short naps taken while in transit or on a couch.