It will take a while. For most people, the underlying question here is “will karate help me be less fearful?” Few people actually ever want to be in a situation where they have to defend themselves, and in reality, very few normal adults will ever have to punch or kick someone in self-defense. However, one of the most significant benefits of karate practice is that, over time, you will become more confident as you realize that you can effectively respond to physical violence if necessary. You’ll also be learning how to avoid many of the situations that can lead to a violent encounter. These things lead to less fear overall – less fear of meeting new people, going to new places, or trying new things.
To answer the original question, it usually takes at least a year for most students to feel that they’ve been able to incorporate enough karate into their existing defensive instincts to improve their self-defense skills under pressure. If this seems like a long time, just remember that being able to perform techniques in the controlled environment of class is not the same as being able to perform while a real attacker is really trying to hit you!