"During seven days you must live in huts (sukkot), all Israelites must live in thatched huts. This is so that your future generations will know that I 'accommodated/hosted' the children of Israel in huts when I brought them out of Egypt. I am the Lord your God." (Vayikra 23:44).
The rabbis explained that to fulfill this Mitzva we should leave our residences and settle in the Sukka. They said in Masekhet Sukka (2,9) "All seven days of the festival, each one should turn the sukka into his permanent residence, and his house into the temporary one"
'Living' in the sukka means that, regular activities we do at home, should take place in the sukka.
We should have all our meals in the sukka. According to Jewish Law, all formal meals, which are defined by the recitation of hamotzi and birkat hamazon, musttake place in the sukka. That is why, when having a formal meal we recite the berakha: ....asher kiddeshanu bemitzvotav vetztivanu leesheb basukka.
Pastries, cakes, cookies, etc. (mezonot) should be eaten inside the sukka.
A snack (a fruit, a salad, a soda) could be eaten outside the sukka. The rabbis, however, praised those pious Jews who during the festival of Sukkot, would not eat or drink anything outside the sukka.
Sleeping in the sukka is an essential part of the Mitzva of settle ourselves in the sukka. However, the fulfillment of this Mitzva depends on two factors: weather conditions (cold and obviously rain) and the physical condition (health, sensitivity to cold, age, etc.) of each individual.
Other regular activities that we normally do at home, like studying, reading, etc. should be done in the sukka as well.
SELECTED ARTICLES ON GILAD SHALIT RELEASE