Short answer
The Umayyads ruled from Damascus from 41 to 132 AH (661 to 750 CE) and descended from Umayya of Quraysh. The Abbasids overthrew them in 750, ruled from Baghdad, and descended from al-Abbas, the Prophet's ﷺ uncle. Both were dynasties after the era of the four rightly guided caliphs.
Sunni scholars see both as Muslim dynasties after the rightly guided caliphate, which the Prophet ﷺ said would last thirty years. They judge each ruler by his deeds, and they honour the scholars of both eras.
The four schools agree on this.
Explanation
The Prophet ﷺ said the caliphate of prophethood would last thirty years, then Allah would give kingship to whom He wills. Scholars count those thirty years as the rule of Abu Bakr, Umar, Uthman, Ali and the months of al-Hasan. After al-Hasan made peace with Mu'awiya in 41 AH, rule passed to the Umayyads, and from Mu'awiya's son Yazid onward it passed by inheritance.
The Umayyads (41 to 132 AH, 661 to 750 CE) ruled from Damascus. Under them the Muslim lands reached from Spain to Sindh. They built the Dome of the Rock and the great mosque of Damascus. Their era also saw Karbala. Umar ibn Abd al-Aziz, an Umayyad, is remembered for justice like that of the rightly guided caliphs.
The Abbasids came to power in a revolution that began in Khurasan, defeating the Umayyads at the river Zab in 132 AH (750 CE). They claimed legitimacy through their descent from al-Abbas, the Prophet's ﷺ uncle. They founded Baghdad in 145 AH (762 CE), and their era saw the great growth of the sciences and of the schools of law and hadith, including Abu Hanifa's students and the authors of the six hadith books. One Umayyad prince, Abd al-Rahman, escaped to al-Andalus and founded a separate Umayyad state at Cordoba.
So the main differences are family, capital, era and character: an Arab conquest state in Damascus, then a more cosmopolitan state in Baghdad. See When did the Abbasid Caliphate fall? and Islamic Golden Age.
The evidence
Sunan Abi Dawud 4646
Grading to be checked... خلافة النبوة ثلاثون سنة ...
"The caliphate of prophethood is thirty years."
After the rightly guided caliphate came kingship; graded hasan sahih.
Where the ruling is recorded
- al-Bidaya wa al-Nihaya (Ibn Kathir), Events of the year 132 AH, the end of the Umayyad state and the start of the Abbasid state. Ibn Kathir's account of the change of dynasty.
- Tarikh al-Khulafa (al-Suyuti), Sections on the Umayyad and Abbasid caliphs. Short lives of each caliph.
- al-Muqaddima (Ibn Khaldun), Chapter on the caliphate becoming kingship. Explains the shift after the rightly guided caliphs.
This answer is pending review by the scholars on our team. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.