Havdalah (Hebrew: הבדלה, meaning 'separation') is a Jewish religious ceremony that marks the symbolic end of Shabbat and holidays, and ushers in the new week. In Judaism, Shabbat ends—and the new week begins—at nightfall on Saturday. Havdalah may be recited as soon as three stars are visible in the night sky. Some communities delay the Havdalah until later, in order to prolong Shabbat. If for some reason one cannot recite Havdalah on Saturday night, it may be observed as late as Tuesday evening.
Havdalah is normally recited over kosher wine or kosher grape juice, although other beverages (except for water) may be used if wine or grape juice are not available. On completion of the Shabbat, a special braided Havdalah candle with more than one wick is lit, and a prayer is recited, and it is customary to gaze at one's fingernails reflecting the light of the candle. Spices, often stored in a decorative spice container, are handed around so that everyone can smell the fragrance. In the Sephardi community, branches of aromatic plants are used for this purpose. After Yom Kippur, a candle is used but not spices.
It has long been customary to beautify and honor the Mitzvah of Havdalah by placing the spices in an artistically beautiful spice box. Spice boxes for Havdalah are among the most lovingly embellished objects of Jewish ceremonial art.
Havdalah is intended to require a person to use all five senses-- to taste the wine, smell the spices, see the flame of the candle and feel its heat, and hear the blessings.
According to some customs, at the conclusion of Havdalah, the leftover wine is poured into a small dish and the candle is extinguished in it, as a sign that the candle was lit solely for the mitzvah of havdalah. Based on Psalms 19:9, "the commandment of the Lord is clear, enlightening the eyes," some Jews dip a finger into the leftover wine and touch their eyes or pockets with it. Because it was used for a mitzvah, the wine is considered a "segulah," or good omen. 
When a major holiday follows Shabbat, the Havdalah service is recited as part of the holiday kiddush. No spices are used, and although the blessing is recited over the candle, the candle used is not the special braided havdalah candle, but rather the Festival candles that are lit. This variation shows that the holiday time continues.
Some Hassidic Jews, particularly (though not exclusively) women, recite the Yiddish prayer God of Abraham before Havdalah. After the Havdalah candle, it is customary to sing "Eliyahu Hanavi" and bless one another with the words "Shavua' tov" (Hebrew) or "Gute vokh" (Yiddish) (Have a good week). In some households, the participants break into a dance.
The text of Havdalah contains an introductory paragraph, followed by four blessings; a blessing on the wine, on the spices, on the candle and on the separation between the holy and the mundane. See List of Jewish prayers and blessings: Havdalah. The Ashkenazic version of the text of the introductory paragraph made up of Bible verses (used by both Ashkenazic and Hasidic Jews) which come from Psalms, the Book of Isaiah and the Book of Esther. Most chassidim and those following the Sefard prayer rite recite the Yiddish prayer Gott fun Avrohom. The introduction to the Sefardic version is slightly different.
The order of elements when havdala is combined with kiddush (e.g., on a Saturday night that is Yom Tov) is known by the acrostic Yaknhaz. This is the initial letters of Yayin (wine), Kiddush (blessing the day), Ner (candle), Havdala (the havdala blessing) and Zman (time, ie shehechiyanu).