How is a prevailing wind/average temperature study conducted to determine the runway direction and length for an airport?
FAA AC 150/5300-13A ("Airport Design") talks a little about this (you want Appendix 2, "Wind Analysis").

Basically you start by figuring out what kind of aircraft you want to operate at the airport, and establishing some basic wind limits (specifically, the maximum crosswind and tailwind components you want to deal with).

Then you call up NOAA's "National Climate Data Center", tell them where you're looking to build your airport, and see if they can have wind data for the location you're looking to build on.


  If NOAA doesn't have data you have a couple of other options -- another nearby airport's wind analysis can be used (if the topography doesn't vary that much and the wind analysis is "recent"), or you may have to perform a wind survey which basically means placing a anemometers on the site to record the wind speed and direction for a year.


Armed with collected wind data you tally up the number of observations in given wind speed ranges and mark them down on a "wind rose".
You then place your runway(s) on the wind rose so that they're aligned with the prevailing winds and determine your "wind coverage" - the amount of time the winds at your site are within your crosswind and tailwind limits.

The advisory circular I linked to shows you how to do this by hand, but there's also software to do this which is how most folks do it. The FAA even has a handy web form which will generate the wind rose and runway/crosswind limit bars for you.



Note that this is just the wind part. As you've alluded to there are a number of other considerations, like terrain: If the prevailing winds favor runway 36, but runway 36 points right at a mountain a mile from the field you might have to align the runway 33 or 03 and sacrifice a perfect headwind for not having pilots fly into the mountain.
Also as ratchet mentioned the airspace around your proposed site may influence your runway layout and types of operations. There's a separate FAA office that deals with "Obstruction Evaluation and Airspace analysis" and a process to go through to ensure that your airport is not deemed "Objectionable".

Also as you alluded to in your question there are other considerations like density altitude (local temperature and humidity trends) which will influence design factors like runway length - there's another advisory circular (AC 150/5325-4B) that talks about runway design criteria, including length considerations.



For even more than you ever wanted to know about airport design you can check out the full 150-series of Advisory Circulars, which all deal with airports in some way (there are ACs on design, construction, markings, lighting, ARFF, and even how to qualify for and obtain federal aid).