Narrated Ali ibn AbuTalib: The Prophet (peace_be_upon_him) said: Allah is single (witr) and loves what is single, so observe the witr, you who follow the Qur'an. (Book #8, Hadith #1411)
Narrated Kharijah ibn Hudhafah al-Adawi: The Apostle of Allah (peace_be_upon_him) came out to us and said: Allah the Exalted has given you an extra prayer which is better for you then the red camels (i.e. high breed camels). This is the witr which Allah has appointed for you between the night prayer and the daybreak. (Book #8, Hadith #1413)
Witr itself, means "odd", and it is an odd number of rakaas.
The time of Witr: After Isha, but before Fajr, and if you plan on doing other night prayers (i.e Tahajjud,) then witr should be done after those.
The Number of Rakaa':
First of all, whatever you do, don't do a replica of Maghrib.
Imam al-Hakim in his book named al-Mustadrak and Imam Ibn Hibban in his Book Sahih Ibn Hibban that the Prophet (SAW) said: "Do not perform three Rakah of Witr resembling to the Maghrib prayer. But you can perform five, seven or eleven Rakah of Witr or more".
Second, you can only do ONE witr prayer. If you want to pray some more after doing witr, go right ahead, but DON'T make another witr.
Okay, so what CAN you do?
You can do any odd number of Rakaa, but the numbers most mentioned are:
1) One
2) Three
3) Five
4) Seven
5) Nine
6) Eleven
7) Thirteen
So HOW do you do it?
First of all, in witr, Quran is recited in every rukaa.
The main event in Witr, that makes it a bit different from your other prayers, is the Qunut (a special dua). Qunut is done in the last rukaa, after the Quranic Recitation, but before bowing and is as follows:
QUNUT
1) Raise your hands and make takbir (say: "Allahu akbar")
2) Fold your arms like usual
3) Recite the Qunut:
"O Allah, guide me aright among those You guide aright,
and grant me health and pardon among those You grant health and pardon.
And care for me among those You care for
And bless me in what You have given
and protect me from the evil of what You have predestined.
You alone decrees, and none decrees against You.
He is not abased whom You befriend.
Blessed are You, O Lord and You are Most High.
And Allah's blessings be on (His) Prophet Muhammad (SAW)
4) Raise your hands and make takbir (say: "Allahu Akbar")
The Number of Rakaa's:
For ONE rakaa':
This is actually a bit misleading, since while Fiqh us Sunnah says the Prophet (SAW) did one Rakaa' of witr, the following hadith shows that it was the necessary Rakaa' to make HIS PREVIOUS NIGHT PRAYERS odd:
Narrated 'Abdullah bin 'Umar : The Prophet said, "Night prayer is offered as two Rakat followed by two Rakat and so on, and if you want to finish it, pray only one Raka which will be witr for all the previous Rakat." Al-Qasim said, "Since we attained the age of puberty we have seen some people offering a three-Rakat prayer as witr and all that is permissible. I hope there will be no harm in it." (Book #16, Hadith #107)
For THREE rakaas:
You have 2 options:
1) Do a 2 rukaa'd night prayer, then a single rukaa'd witr as before.
2) Do a three rukaa'd witr, in which tashahhud is done only in the last rakaa, followed by taslim (salams)
For ANY OTHER ODD NUMBER of rakaa's:
You have 3 options:
1) Do many 2 rukaa'd night prayers, then do a one rukaa'd witr, so by the time you've finished this witr you'll have done the necessary number of rukaas. So, for example, 5 rukaas would be : 2 rukaa'd night prayer, 2 rukaa'd night prayer, one rukaa'd witr.
2) Do an odd numbered rukaa'd prayer, with two tashahuds: one in the second last rukaa, and one in the last rukaa, then taslim (salams).
3) Do an odd numbered rukaa'd prayer, with only one tashahud done in the last rukaa, then taslim (salams).
What to recite during witr:
Recite whatever you like, but it is preferred, that in the first three rukaa's to recite:
Rukaa one: Al-A'la
Rukaa two: Al-Kafirun
Rukaa three: Al Ikhlas, Al Falaq, and An Nas.
What to recite after Witr:
Glory be to the Master, the Holy
Glory be to the Master, the Holy
Glory be to the Master, the Holy
Lord of the angels and the spirits
O Allah, I seek refuge in Your pleasure from Your anger.
And I seek refuge in Your granting well being from Your punishment.
And I seek refuge in You from You.
I cannot reckon Your praise: You are as You have praised Yourself.
Sources: Fiqh us-Sunnah by As Sayyid Sabiq
go to searchtruth.com and look up witr. You'll get a bunch of hadith confirming everything I've said :)