The par for a hole is primarily based on the length of the hole, but other factors can also affect its value; most noticeably the type of terrain and any potential obstacles (water, hills, buildings etc). Wikipedia article for Par
The USGA lays out the following guidelines for par computation;
To quote their advice on par computation;
Yardages for guidance in computing par are given below. The effective playing length of a hole for the scratch golfer determines par. (See Section 13-3b.) These yardages may not be applied arbitrarily; the configuration of the ground and the severity of the obstacles should be taken into consideration.
Authorized golf associations are empowered to adjudicate questions of hole par. (See Decision 16/1.)