The location is determined several years in advance (we already know the location of 2019 US Open) by USGA Championship Committee using a lot of criteria. First of all, obviously, is the quality (and difficulty) of the course. The location should also move around to different parts of the country (2011: Maryland, 2012: California, 2013: Pennsylvania, 2014: North Carolina, 2015: Washington, …).
See a detailed article at USGA.org:
Before a venue is selected to host a U.S. Open, it is carefully examined by the USGA to ensure it meets key criteria. First and foremost, the golf course must be of excellent quality and design. Can it be set up to adequately test the world's best players? If the answer is "yes," the USGA staff then thoroughly study the operational aspects of the site and local community. There must be enough land surrounding the golf course for tents, operational compounds, admission entrances, and spectator transportation. The golf course must have enough space between and around golf holes for grandstands, TV towers, concession areas, and for the relatively unimpeded movement of thousands of spectators. Outside the golf course, we examine the potential space for parking upwards of 14,000 to 20,000 vehicles, the likely traffic conditions to shuttle spectators via bus between parking and the golf course, the availability of thousands of hotel rooms and a convenient airport, and the anticipated cooperation from the state and local governments, as well as the local business community.