It is known that electron behaves as a wave also.
How does electron know that it has to change into a wave?
Are there any factors that influence the behavior of electron changing into wave?
The electron is always a wave.
The electron is wave, as experiments of diffraction and interference showed.
Waves come in an infinity of "shapes". Some kinds of shapes have some properties, and others have other properties. Examples of properties are position and momentum. The two shapes of the electron's wave having these properties are
When the wave is concentrated at a point. In this case, it has a definite position. It doesn't have a definite momentum.
When the wave is a plane wave, having a definite frequency (more complex shapes can be obtained by superposing various frequencies). In this case, there is no definite position, since the plane wave extends in all space.
The problem is, when does the electron how to be plane wave, or to be concentrated at a point. The answer is strange. If you measure the frequency (or momentum), you will find that the electron is a plane wave. If you measure the position, you will find that the wave is concentrated at a point.
Yes, you understood well. The electron, and any other particle for that matter, has precisely the kind of shape for which the property you want to measure is defined. Measure another property, which is not compatible with the property previously measured, and you will find it has another shape. Now, this may look strange, but this is how it happens.
Wait, there is more, when more particles of the same kind are present. Then, saying it is a wave is not enough. But this is another story.
You should be aware that you don’t have to accept that the electron is always a wave, or that it’s neither a wave nor a particle. It is true that in the orthodox QM we only have waves (particle-like behavior is a special case). But that is not the only quantum theory that we have.
For example, you can say that the electron is a particle which is guided by wave function (which generates the velocity field on the configuration space). And suddenly, you have the theory (Bohmian mechanics) with particles and trajectories (without measurement axiom, complementarity or other obnoxious things) which is able to reproduce all results of orthodox non – relativistic QM.
If you want to know more about Bohmian mechanics, I would like to recommend you this introductory article: http://math.rutgers.edu/~tumulka/papers/bm.pdf