Some were original colonies, some land was purchased, some stolen from other countries and some settled. In truth they were all stolen from the native inhabitants. It just happens the super powers of the day would fight wars and sell other people's lands.
Beyond the first 13, which formed the initial nation, each state has it's own story. Most of them were unsettled territory acquired by the United States, and then slowly settled (or not so slowly in places like Oklahoma). Once they had enough American citizens living in them, they typically made a bid for statehood. A few states were captured through warfare and/or guile.
Each applied for and was accepted for Statehood. But did you know....there were some in the original 13 states that didn't want to accept any more territories. Those 13 colonies fought and died for their freedom and they didn't want others to just join in with all the benefits and none of the pain. Interesting.
Lots of different ways, in fact each state has its own story - Maryland was an original English colony, Texas was annexed, WV was divided off of Virginia during the Civil War... You can watch the show "How The States Got Their Shapes" for more info.