On the doorposts of traditional Jewish homes (and many not-so-traditional homes!), you will find a small case like the one pictured at right. This case is commonly known as a mezuzah (Heb.: doorpost), because it is placed upon the doorposts of the house. The mezuzah is not, as some suppose, a good-luck charm, nor does it have any connection with the lamb's blood placed on the doorposts in Egypt. Rather, it is a constant reminder of G-d's presence and G-d's commandments.
The commandment to place mezuzot on the doorposts of our houses is derived from Deut. 6:4-9, a passage commonly known as the Shema (Hear, from the first word of the passage). In that passage, G-d commands us to keep His words constantly in our minds and in our hearts, by (among other things) writing them on the doorposts of our house. The words of the Shema are written on a tiny scroll of parchment, along with the words of a companion passage, Deut. 11:13. On the back of the scroll, a name of G-d is written. The scroll is then rolled up placed in the case, so that the first letter of the Name (the letter Shin) is visible (or, more commonly, the letter Shin is written on the outside of the case).
The scroll must be handwritten and must be placed in the case to fulfill the commandment. It is commonplace for gift shops to sell cases without scrolls, or with mechanically printed scrolls, because a proper scroll generally costs more than even an elaborately decorated case. According to traditional authorities, mechanically printed scrolls do not fulfill the mitzvah of the mezuzah, nor does an empty case.
The case and scroll are then nailed or affixed to the right side doorpost on an angle, with a small ceremony called Channukat Ha-Bayit (dedication of the house - yes, this is the same word as Channukah, the holiday celebrating the rededication of the Temple after the Maccabean revolt against Greece). A brief blessing is recited.
Why is the mezuzah affixed at an angle? The rabbis could not decide whether it should be placed horizontally or vertically, so they compromised!
Every time you pass through a door with a mezuzah on it, you kiss your fingers and touch them to the mezuzah, expressing love and respect for G-d and his commandments and reminding yourself of the commandments contained within them.
It is proper to remove a mezuzah when you move, and in fact, it is usually recommended. If you leave it in place, the subsequent owner may treat it with disrespect, and this is a grave sin. I have seen many homes and apartment complexes where mezuzot have been painted over by subsequent owners, and it breaks my heart every time I see that sort of disrespect to an object of religious significance.
Source: Judaism 101.