International Plumbing Code: Not less than 18" but not greater than 42"
But it really depends on where you live, local codes, as well as the clothes washer manufacture.
Height Limit Factors:
- The internal pump within the clothes washer needs to pump the discharged water vertically. It will have a limit as to how high it can pump. That is what limits the upper height.
- Once the pumped water transitions from being forced by the pump to draining by gravity, depending on the GMP of the pump, there will be a backup of water as the water will drain slower by gavity. This limits the lower height.
You mention that the fixture drains have 'good slope' in one of your comments. Just be aware that there is a limit as to how much slope you can have on a pipe. The slope on a fixture drain cannot exceed that of the diameter of the pipe. Once you exceed the diameter of the pipe, the vent is cut off and the trap seal of the trap is no longer protected.
My local code limits the total change of direction on a fixture drain to 135° (the exception being toilets are allowed 225°). So here, the fixture drain for the clothes washer would pass as its total change is only 90°. However, the fixture drain for the sink would fail as it has a total change of direction of 180°. (This is my first time looking at the International Plumbing Code and I did not see this limitation during my quick skim, but it may be there, or somthing similar and I missed it.)
Regarding the termination of the clothes washer standpipe:
- you can cut a hole in the wall to get to the top of the standpipe
- you can rise verticaly in the wall and use one 45° near the top and come out of the wall on a 45°, or
- use a manufactured laundry box
The benefit of a laundry box, in addition to a neat and clean installation, is that you can get one with water stops. Some locations may require by code that you have hammer arrestors on the water supplies to a clothes washer. Most laundry boxes come with the option to have them installed on the stops.
Relevent Excerpts from the International Plumbing Code
AUTOMATIC CLOTHES WASHERS
406.2 Waste connection. The waste from an automatic clothes washer shall discharge through an air break into a standpipe in accordance with Section 802.4 or into a laundry sink. The trap and fixture drain for an automatic clothes washer standpipe shall be not less than 2 inches (51 mm) in diameter. The fixture drain for the standpipe serving an auto- matic clothes washer shall connect to a 3-inch (76 mm) or larger diameter fixture branch or stack. Automatic clothes washers that discharge by gravity shall be permitted to drain to a waste receptor or an approved trench drain.
1002.1 Fixture traps. [...] The height of a clothes washer standpipe above a trap shall conform to Section 802.4.
802.4.3 Standpipes. Standpipes shall be individually trapped. Standpipes shall extend not less than 18 inches (457 mm) but not greater than 42 inches (1066 mm) above the trap weir. Access shall be provided to standpipes and drains for rodding.
FIXTURE DRAIN. The drain from the trap of a fixture to a
junction with any other drain pipe.
909.2 Venting of fixture drains. The total fall in a fixture drain due to pipe slope shall not exceed the diameter of the fixture drain, nor shall the vent connection to a fixture drain, except for water closets, be below the weir of the trap.