Cotton has been cultivated in both the new and old world's for thousands of years. The earliest known cultuvation was in Pakistan around 7,000 years ago. Cotton has also been grown and harvested in India, North Africa, Mexico, South America and Asia for between 2,000-5,000 years. Europeans who came into contact with cotton called it, "tree wool" and commented on it's softness and versatility.
Cotton is a difficult plant to harvest because it is very suseptible to drought and requires large amounts of water to grow. It also requires a significant amount of labor to harvest and clean. Prior to the advent of the cotton gin it took dozens of man hours of labor to produce just a single pound of lint.
That all changed thanks to Eli Whitney, who invented the cotton gin in 1793. This device sped up the production of cotton significantly and led to higher cotton outputs from global growers.
Cotton is the crop most closely associated with slavery, especially in the American South, due to the high amount of labor that was required to produce it.
After the Civil War mechanization replaced human labor, but the U.S. remained the worlds larget exporter of cotton.