It dates from 1889 and was the creation of a remarkable Anglo-Hungarian linguist and religious scholar named Gottlieb Wilhelm Leitner.
Born in Budapest, Leitner came to London when he was 17, by which time he was already able to speak 15 languages. He spent much of his career as an educationalist in British India but, when he returned to England in 1883, he established an Oriental institute in the slightly unlikely setting of Woking, devoted to the study of eastern languages and culture.
The Shah Jahan Mosque was built as a place of worship for those Muslims who came to visit the institute or study there. It survives to this day and remains the local mosque for the Muslim population of Woking.
Answered by Nick Rennison.