Both are grammatically correct, but depending on context the have different implications.
"I hope you won't mind" implies a more remote possibility - it's more "polite" and establishes more of a distance between the speaker and listener. It implies something can be done so that the knock on the door doesn't happen, if the listener does, indeed, mind.
Technically, the "don't" is present simple tense, implying a fact. "Won't" is first conditional.
You can change the sentence to "You won't mind when I knock on your door, will you?" (which alters the semantics and "mood" of the sentence but not the meaning) - it's noon now, I will knock on your door at three, and I want to make sure that isn't a problem.
"...if I knock..." means maybe I will, maybe I won't knock on your door at 3, and i want to make sure there's no problem if I do.
"You don't mind when I knock on your door" means I have done it before and will probably do it again.
"I hope you don't mind if I knock on your door" is awkward, but implies something possible in the future.