Whether to split the infinitive or not to split it, depends on the sentence.
Whether or not to split the infinitive,...
Which is better regarding grammar and style? (is the comma placing correct as well?)
The second is wrong in terms of the grammar. You could say, "Whether to split the infinitive or not, ..." (I'd prefer this one)
or "Whether to split or not the infinitive, ..." (although this one sounds a bit odd to me; I'm not entirely sure)
I would put a comma there, but opinions on punctuation usage always seem to vary.