The law that set up the process to create territories and state on the western frontier of the US was the Northwest Ordinance of 1787.
This law set some rules for how/when a state would be admitted in to the US. It also set rules on the education of the territiories within it. Also based on the population as it increased they could have a bigger and have more say in the government and all the rules for that. Also it outlawed slavery in the new territories.