Originally Posted by K'ledgeBldr
Since the house is only 7yrs old- it would be safe to assume that the windows are of a thermal variety(?) And I'll assume that the frames are aluminum. More than likely, it's probably no flashing- rather than "flashing improperly installed". Even at that, water infiltration is somewhat hard to achieve (provided there is an eve or soffit above) unless the window(s) are facing in the direction of prevailing winds/ storm paths or errant sprinkler head(s). Then they're subject to blowing rain. What is the exterior cladding (siding, brick, etc.)? That will make a big difference in cost.
If they are aluminum frame windows, I'll assume that the window openings are d/wall wrapped. This can create a thermal bridge- allowing condensation to form on the interior. Then the condensation is absorbed by the d/wall thus, creating the staining.
Another excellent K'ledgeBldr post! Pretty much sums it up.
Has your Inspector provided a detailed description in their report of what they found, where it was found and the extent of the staining? If so can you cut and paste the wording here? Also as noted what is the exterior cladding? Is this a one story or two story home? Were the stained window trim on one or both floors? Were the stained window trim on just one side of the home and what direction does it face? Were any issues noted in the report with improper exterior sealing (caulking, trim, etc.) around windows? Did the Inspector note any other staining on walls or ceilings nearby these windows?
In addition to what K'LedgeBldr noted (which are the most likely causes) there are other potential causes of the staining around the windows. The other causes are not common but can potentially be occurring. The other signs in the questions noted above can point to these other potential causes.
The issues beyond condensation and exterior sealing/caulking would require at least some small level of destructive inspection. That is removing drywall or exterior cladding to determine the cause and extent of any damage.
If I had to choose, based only on what you have provided for information, I would choose either the condensation or exterior sealing/caulking as the issue. These are the most common issues we see.