The Code does not stipulate the distance from grade (soil) up to a window. However, it does REQUIRE (not recommend) that there be a minimum of 6" from grade to siding, sheathing and wood framing, or the wood needs to have a wood preservative (we call it pressure treatment and we often abbreviate it PT). (See Section R317)
However, we've all "cheated" on this and encroached on this 6" minimum to keep a good slope away from a building. In fact, the Code allows siding, sheathing and wood framing to be within 2" of concrete steps, porch slabs, patio slabs, etc. The difference being one is measured to the dirt and one is measured to a "hard surface"...I guess they require extra protection where bugs can crawl out of the ground. (See Section R317, Item 5)
If you can keep 3"-4" from the dirt to the wood, I don't think you'd have a problem, unless you live in a termite prone area. If so, you may want to stay at 6" minimum. (Do you have a "termite shield"? It's a piece of metal flashing installed at the bottom of the siding.)