With 14.2% of the population, or roughly 172.2 million people, identifying as Muslims in the 2011 Census, Islam is the second-largest religion in India. India also has the second-highest percentage of Muslims in the world.Shia Muslims make roughly 13% of India's population, with Sunni Muslims making up the rest.
How Did Islam Entered India?
Shortly after the religion first appeared in the Arabian Peninsula, Islam flourished through Indian communities along the Arab coastal trade routes in Gujarat and along the Malabar Coast. Islam entered India's interior during the Arab conquest of Sindh in the 7th century, and it later spread to Punjab and northern India during the Ghaznavid and Ghurid conquests in the 12th century.
Since then, Islam has shaped India's religious and cultural heritage. Three of the earliest mosques in India that were constructed by seafaring Arab merchants are the Barwada Mosque in Ghogha, Gujarat, built before 623 AD, the Cheraman Juma Mosque in Methala, Kerala, built in 629 AD, and the Palaiya Jumma Palli (or The Old Jumma Masjid), built in Kilakarai, Tamil Nadu, in 628–630 AD.
The majority of conversions, it is claimed, were coerced, and those who refused to pay high Jeziya (poll) and Kharaj (property) taxes or risk execution were compelled to convert. Conversions have occurred since the eighth century, but Indians were not coerced into them.
During the time of Muhammad the Prophet, Muslims came in India, building mosques and coordinating missionary activities in the seventh century C.E. The effectiveness of those missionary endeavours helped Islam become deeply ingrained in Indian culture.
As is common with missionary movements of many religions, commercial and merchant activities coexisted with missionary work. Before the birth of Muhammad, there were Arabs living in India. Since Arab traders who had previously established themselves in India and converted to Islam had a base of operations set up, this probably made it easier for Islam to gain a foothold in the extraordinarily diverse religious and cultural landscape of India.
However, whatever may be the cause of inclusion of Islam in the Indian subcontinent there's no evidence that prophet Muhammad ever visited India in his lifetime.
I hope your question was answered.