Usually, that stucco trim around the window is made with rigid foam with a stucco parge coat. Many times, the foam disintegrates and the stucco facade easily fails.
In this case, if there is a foam backer, it might be holding water, or conversely, not have a proper slope to let water drain. Which direction is this window facing?
You'd need to scrape the caulk and reapply. However, there is probably a deeper cause to the discoloration.