Either add periods after a and m or capitalize both letters. (The numeral 4 is correct only because of the unit of measure immediately after it; if you didn’t use a.m./AM, you’d need to write it as four in the morning or four o’clock.)
The example is one of those sentences in which the lack of a comma actually changes the meaning. As originally written, not only does the neighbor shine a light every morning, but you decide every morning at four to find out why. Kinda silly, eh? Add a comma after window, and the sentence says that the neighbor shines a light every morning, but your decision to find out why happens just now.
Every night at exactly 4AM, your neighbor from across the street flashes a flashlight through their front window, and you decide to find out why.
For even better clarity of meaning (so people who don’t know commas aren’t confused), make this two sentences by changing the comma to a period and deleting and.