Urdu is a language that is spoken by Muslims in South East Asia and is a language that came into existence because Mughal rulers and officials needed a language to communicate with subjects and local inhabitants of central India. The language that Mughals spoke was a Turkish language containing Arabic and Persian words. The language that so developed had a base of Indo Aryan languages (Sanskrit in particular) but retained Arabic and Persian words for literary and technical uses. Soon, the language became a court language of the Mughal Sultanate (empire) and a language that even inhabitants gladly accepted as another language. Urdu is today a fully developed language with a script of its own that is a derivative of Persian alphabet that in itself is a derivative of the Arabic language. Urdu is written from right to left. Urdu is a language that contains a base of Hindi and Sanskrit words though superimposing Arabic and Persian words with a splash of Turkish and even English words.
Arabic is the sacred language of all Muslims around the world and it is the script that has been used in the holy Quran as well. Arabic includes both the ancient script as well as the modern standard form of the language as it is spoken in the Arab World. In entire Middle East and North of Africa, Arabic is the lingua franca. Urdu is another language spoken by Muslims, mostly from South East Asia. There are some similarities in the spoken version of the language though there are glaring differences in their written versions reflecting their different origins and influences.
When we talk of Arabic, we have to remember that being an ancient language, there are many versions of spoken language and these versions are different from the written script of Arabic language. Written version is more conservative and reserved for official functions while spoken version is liberal and has assimilated influences of languages of different areas where Arabic is spoken. These differences, on a continuum, make for two very different languages on two extremes but for political reasons, these differences are set aside and the languages are grouped together as Arabic.