In soil science the various distinct strata within the soil are referred to as horizons. It is important to keep in mind that a soil classification does not refer to 'sandy' or 'loamy', but refers to a layered sample involving multiple horizons, which may extend from a surface layer of compost all the way down to the bedrock, passing through any number of horizons along the way.
While the W horizon is certainly not a common one, it is important in determining soil classification. The W horizon is simply a layer of water over the top of the soil. In order to be classified as a horizon, the water must be more-or-less a permanent feature, but not so deep as to prevent plants from rooting in the soil. In practice, this means fens, bogs, mudflats, and marshes. These ecosystems have an active population of plants and/or mosses that provide the basis for active soil formation, generally in the form of peat.
In these ecosystems the soil layer normally referred to as the O horizon is often referred to as the P horizon (P for peat), but is otherwise treated just the same. The P1 horizon is found immediately below the W horizon, and consists of an accumulation of partly decomposed organic matter, in which the original structures are generally identifiable. The P2 horizon is found below that, and consists of fully decomposed organic matter in which the organic structures are mostly indiscernible.
In some cases, as in quaking bogs, schwingmoors, or floating marshes, a layer of decomposing Sphagnum Moss may float on top of the water layer; in this case the floating layer may be described as Oa1, while the layer below the water may be Oa2. However, this convention may change from place to place.
In some systems the W horizon refers to something completely different; the Weathered horizon is a term for weathered bedrock (a subtype the R horizon); this zone would appear between the C horizon and the R horizon, and is not in very common usage; it is most often used when referring to tropical soils.