Visiting Madinah is highly recommended — pray at Masjid al-Nabawi, visit the Rawdah, Masjid Quba, and Uhud; the Haramain train connects Makkah to Madinah in 2-3 hours.
Visiting Madinah is highly recommended and most Hajj packages include it, though it is not a ritual obligation of Hajj. The Prophet (peace be upon him) said: 'A prayer in my mosque is better than a thousand prayers in any other mosque except Masjid al-Haram' (Bukhari and Muslim). There is no ihram requirement for visiting Madinah — you travel in your regular clothing.
Key sites to visit include: Masjid al-Nabawi for prayers and visiting the Rawdah (the area between the Prophet's pulpit and his chamber, described as a garden of Paradise), sending salutations upon the Prophet at his grave, praying at Masjid Quba (praying two rak'at there equals the reward of an Umrah according to hadith), visiting the Uhud battlefield and the martyrs' cemetery, and exploring the famous date market. The Haramain high-speed train connects Makkah to Madinah in about 2-3 hours and is the most comfortable option. Most pilgrims spend 3-5 days in Madinah.
Source: Sahih al-Bukhari; Sahih Muslim; Sunan al-Nasa'i