Although the fact may seem counterintuitive for a component on trucks that (by definition) cross state lines, the federal government leaves regulations for mud flap locations, heights and other particulars to individual states. Most states maintain the same sorts of regulations regarding mud flap usage, but a few have restrictions based on individual state preference.
In most states that require mud flaps on commercial vehicles, said vehicles are required to use them if they are licensed, registered and capable of operating on public roads at speeds of more than 25 miles per hour. States that require mud flaps call for using one for each rear wheel (two per side on tandem axles), or one really wide one large enough to cover both.
Distance and Mounting
Most states share a common formula for mud flap placement. Although the mathematics seem esoteric, they're simply intended to keep water and debris from slipping from under the tire and hitting the car behind at an angle greater than 22.5 degrees. In inches, measure the distance from the tyre's rearmost point of contact (with the trailer fully loaded) with the road to where you'd like to mount the mud flap, and multiply it by 0.4142. Take that measurement, and measure upward from the ground at your desired mounting point; this is your maximum allowable mud flap ground clearance. Example: if you wish to mount the mud flap 18 inches from the rearmost contact point of the rear tire, multiply 18 by 0.4142; this gives you a maximum of 7.45 inches from the ground. A simpler calculation often used by roadside officials to determine angle is 5 inches of vertical rise for every 12 inches horizontal from the contact patch.
Regardless of the mudflap's distance from the wheel centre, one nearly universal rule is that it can never be more than ten inches from the ground. Many states (like Texas) have height restrictions under ten inches (usually eight inches while driving), but ten is the maximum allowable. Using the 0.414 rule of angle, maximum distance from the tyre's rear contact patch will rarely ever be more than 24.14 inches.
Accents and Lights
Some states (like Michigan) prohibit the use of any kind of light or reflector on the mud flap. Basically, anything that can break if and when the mud flap comes off is prohibited; this can also include the chrome accents sold at truck stops (like the infamous and popular "reclining lady"). Rubber accent pieces are generally permitted, but most are cast right into the mud flap's surface so they can't come off anyway.