The Sages instituted that in addition to reciting Havdala in Shemoneh Esrei one must likewise recite Havdala over wine, if wine is available.
Is Havdala of a Biblical or Rabbinical origin? Some Poskim rule the words recited in Havdala are of Biblical origin. Others rule it is of Rabbinical origin. [According to all however the obligation to say Havdala twice, once in Davening and another time over wine, is Rabbinical. Thus if one already said Havdala in Davening saying Havdala over wine is only a Rabbinical obligation.]
May one recite Havdala in middle of a meal prior to Bentching? It is proper to initially avoid saying Havdala prior to Birchas Hamazon if one drank wine during the meal, or is saying Havdala over other beverages. If one desires to say Havdala over wine and did not drink wine during, or before, the meal, he may say Havdala prior to Birchas Hamazon according to all. If one chooses to say Havdala during the meal despite having drunk wine during that meal, see Halacha 2 for the relevant details.
May one say Havdala and do Melacha prior to Maariv? Once Shabbos has ended, which is when a row of three small stars are visible, it is permitted to say Havdala even prior to Davening Maariv. [Some Poskim however rule it is always proper to first Daven Maariv and then do Havdala in order to follow the set order that the Sages established. In a case that one recited Havdala prior to Maariv it is nevertheless permitted to eat those foods that are permitted to be eaten before Maariv.]
May one place the Havdala wine on the table prior to the leave of Shabbos? No. One may only bring the Havdala wine to the table when Shabbos is over.
 It is an obligation to search for wine for Havdala just as is required to fulfill any other Mitzvah which is an obligation for one to fulfill. [ibid]
Originally when the Anshei Kneses Hagedola instituted the recital of Havdala, together with the other prayers, blessings and Kiddushim, they did not obligate Havdala to be said over wine, but rather within the prayer of Shemoneh Esrei. The reason for this is because when the Jews returned from exile in Babylon they were destitute and could not all afford wine for Havdala. [294/1] After the Jewish people became more financially stable the Sages instituted for Havdala to be said over wine. Later they once again became destitute and the Sages retracted that Havdala is to be said only in Shemoneh Esrei. Now, in order to prevent Havdala from being constantly moved from the prayer to wine and from wine to prayer based on the Jewish economic state, the Sages instituted that in addition to reciting Havdala within prayer, one is also obligated, if wine is available, to also recite Havdala over wine. If however there is no wine available one fulfills his obligation of Havdala within Havdala said in prayer. [294/2]
 296/19; See Lekutei Sichos 31 p. 99 for a thorough analysis on the opinion of the Rambam in what is the essence of the Mitzvah of Havdala. The Rebbe there gives three possible options for the reason behind the obligation, and explains the practical ramification between each approach.
 Some Poskim [Rambam; Chinuch] rule Havdala is a Biblical obligation which is learned from the words Zechor…Lekadsho. They expound this verse to mean one must mention Shabbos both by its entrance and by its leave. [ibid]
 Rabbeinu Tam; Shivlei Haleket
 They rule the words Zachor only refers to remembering Shabbos when it enters and not when it leaves. [ibid]
Regarding the opinion of Admur: In 296/19 Admur does not side like either opinion, and rather suspects for both regarding women saying and hearing Havdala. In however 271/1 he brings the first opinion that Havdala is Biblical as the Stam opinion, while the second opinion which holds it is Rabbinical he brings as “Yeish Omrim”.
 Kaf Hachaim 296/1; See Piskeiy Teshuvos 296/1
 271/9; Kuntrus Achron 299/2; Based on M”A 235/4; so brings Kaf Hachaim 299/5 from Magid Meisharim; Piskeiy Teshuvos 295/5
 As it is a Mitzvah for Kiddush and Havdala to be recited at the first opportunity. Hence by Kiddush one is to recite it as close as possible to the entrance of Shabbos, and by Havdala one is to recite it as close as possible to the leave of Shabbos. [ibid] It is for this reason that the Sages forbade eating and drinking prior to Havdala so one not come to delay making Havdala due to this eating. [Kuntrus Achron 299/2]
See Kaf Hachaim 299/5 which brings the Yalkut Reuveini in name of the Maggid Meisharim that says based on Kabala one is to say Havdala immediately after Maariv in order to distance oneself from the Kelipos which desire to attach to oneself after Shabbos.
 Admur records a dispute on this matter:
The first [stam] opinion rules one may say Havdala prior to Birchas Hamazon, and if he drank wine during the meal he omits the blessing of Hagafen. The same applies if he is saying Havdala over other beverages, that he omits the blessing of Shehakol. Others however rule one is to always say the blessing over the cup used for Havdala. Practically Admur rules the main opinion is like the first opinion, although it is best to initially avoid the dispute and hence say Birchas Hamazon prior to Havdala. [ibid]
 So rules Admur in 299/4 Kuntrus Achron 3, and so also rules Chayeh Adam 8/19 brought in Kaf Hachaim 299/17; M”B 299/10. The reason is because the dispute was only relevant in a case one already drank wine during the meal and it hence exempts the blessing over wine in Havdala according to the first opinion.
Other Opinions: Some Poskim rule one is not to initially say Havdala during the meal even if he did not drink wine during or before the meal as by doing so one enters himself into a dispute if he may continue eating without a Bracha or he must say Hamotzi again. [Elya Raba 299/8; Siddur Yaavetz; Tosefes Shabbos 299/6] Admur in Kuntrus Achron 299/3 negates these opinions.
 Tehila Ledavid 293/1; see Kitzur Halachos Shabbos p. 119;
In however the Sefer Pear Yisrael 1/207 he writes that the Alter Rebbe at times would say Havdala prior to Maariv.
 Pashut. See Piskeiy Teshuvos 299/14
Other Opinions: The M”B 299/35 rules one may not eat or drink until after Havdala. Many Poskim have left this ruling of the M”B with a Tzaruch Iyun. [See Tzitz Eliezer 16/17; Sheivet Haleivi 9/63]
 254/10: “It is forbidden to prepare on Shabbos for a weekday, even in a situation that [doing so] does not involve even a remote similarity to a Shabbos prohibition, but rather only [to simply] move an object, such as [for example when one wants] to bring wine from the cellar to the house on Shabbos to use for Havdala after Shabbos, [this is nevertheless prohibited,] and [so too] anything similar to this [is also prohibited], as will be explained in chapter 503, with regards to Yom Tov, see there.”