As far as my understanding, Hindi is an Indo-European language. I am not too sure of Urdu's language family, but I would assume that it is the same. The languages are identical in their vernacular, but are extremely distinct outside of vernacular usage.
They aren't distinct languages. In fact, they aren't even really dialects, they're just two ends of a spectrum. I guess the best analogue would be that in English, you can either ask for help, or you could demand assistance: they both mean the same thing, but the former phrase uses Anglo-Saxon vocabulary and the latter uses French/Latin vocabulary. It's the same with Hindi/Urdu: in many cases, you have two ways of saying the same thing, either using a Sanskrit word or a Persian/Arabic word. People who tend to have a preference for Sanskrit words are called Hindi speakers, and people who tend to have a preference for the Persian/Arabic words are called Urdu speakers, but a Hindi speaker will sometimes use a Persian/Arabic word and vice versa for an Urdu speaker.