A “commonwealth” is defined as a “free state, or republic, characterized by a representative government”. So technically any of the United States can be considered a commonwealth. But four of the States formally refer to themselves as Commonwealth rather than State: The Commonwealth of Kentucky, Commonwealth of Massachusetts, Commonwealth of Pennsylvania, and Commonwealth of Virginia. There are no differences under US law between a State and a Commonwealth. So why did four of them opt for this name, considering they are part of the United States and not the United Commonwealths?
Well, Kentucky is easily explained. In 1792 it was carved from the Commonwealth of Virginia to become the 15th state, so we can assume they just kept the convention set by Virginia. But what about the others?
The answer lies in the origin of Virginia, Massachusetts and Pennsylvania, which were three of the original thirteen colonies. When they officially became States, the historical term Commonwealth was used symbolically to emphasize that the power of the state government was derived from the people, rather than from their history as a royal colony.
You should also know that Puerto Rico is officially the Commonwealth of Puerto Rico, although it’s an “unincorporated territory” of the United States, not a State.