I came across the both sentences:
This is the girl whom I married.
This is the girl to whom I married.
Which one is grammatical? Please explain.
Whether you use to depends on whether the verb requires a direct or indirect object.
For example, you would say:
He is the man whom I saw at the market
The man is the direct object of the verb saw so you can't say to whom I saw.
But you can say:
He is the man to whom I gave the letter.
Because what you gave was the letter, not the man. You gave the letter to the man. The man is the indirect object.
So the question is: does marry take a direct or indirect object. This gets a bit tricky because although you marry someone, you get married to someone.
In this instance, you have a choice. You can say either:
This is the girl whom I married
This is the girl to whom I am married.