Sealing/Repairing Window Drywall
These look like aluminum windows. Most likely the problem here isn't water intrusion, but the windows "sweating" in the winter. The water then gets wicked up by the drywall about 1-2" from the window itself.

Your first option is to replace the windows with vinyl. That will provide you with better insulation overall and you can eliminate the sweating entirely. This is also expensive and difficult.

The second option is to tear down the drywall next to the windows and put up, say, 1x4 vinyl planking. Since you'll be tearing out the metal casing along the edge too, what I would suggest is casing the wall around the window in door casing. It will hide the ripped-out drywall damage and, once caulked, it will look quite attractive.