In conversation, it’s normal to say:
What time do you have to be at the train station by?
Note: What time do you have to be at the train station vs What time do you have to be at the train station by, mean 2 completely different things, right?
1) The question in the title
2) Whether by is a preposition or not.
Winston Churchill once said
“That is the sort of thing up with which I will not put!
In informal registers, when a wh-interrogative pronoun is the object of a preposition, it is common for the preposition to shift to clause-final position:
What book are you interested in?
Who are you baking a cake for?
What school do her children go to?
Who did he come to the dance with?
If a “heavier” sentence element like a prepositional phrase intervenes, one can also hear:
Who did he come with to the spring dance?
In more formal registers, stranded prepositions such as these might be considered out of place, but simply slapping the preposition in front of the interrogative can yield an awkward sentence:
In what book are you interested?
What book interests you?
What book are you interested in reading?
To what school do her children go?
What school do her children attend?
Where do her children go to school?
Beginning a question with with or for whom will not, in formal registers, cause odd stares.
According to the source cited above:
With which card did you pay?
is just as acceptable in formal registers as informal.
Grammar is not absolute, but contextual. In informal settings, no one but the most dessicated pedant would insist the stranded preposition in these questions is a grammatical error.
The difference in meaning between your example sentences is minimal. By has the air of the future perfect about it: “By what time will you need to have arrived at the station to catch your train?” Just asking what time you need to get to the station asks only for a single point of arrival. In any case, the answer is going to be the same.
By, by the way, is a preposition whose object is the what-phrase.
The supposed Churchill quote ridiculing a narrow hyperprescriptivism is purported to have originally read:
This is the sort of bloody nonsense up with which I will not put.
This sounds a lot more like Churchill, but, alas, the chances of the statesman ever having actually uttered the sentence seem rather slim.