How danger is for a baby of 4 m to sleep near the window at night, his bed is near z window1 m away, its summer but im still worrynof the wind at night?

Is perfectly OK. Provided room temperature & wind temperatures are are neither too hot nor too cold. Don't worry. If or when in doubt shut the window.
The wind won't hurt. No matter what you may have heard a gentile breeze is a benefit to babies. The "wind" does not cause ear infections or colic. Enjoy the plesent weather if you have it.