It was founded in a couple different ways, and each benchmark could be spoken of as a year of founding.
Initially it is credited to John Winthrop, who sailed over on the Arbella in 1629, and founded Boston in 1630, under a charter from the King of England to establish the Massachusetts Bay Colony.
Prior to that, we know the Pilgrims, who were separatists from the Church of England determined to settle in the Jamestown Colony in Virginia, got lost in a storm, landed nearby in this same area, and established their own Plymouth Colony in 1620, which was later ordained by the King of England. Also, there was a separate settlement in Cape Ann by the Dorchester Company, meaning to establish the Dorchester Colony in 1624, which was ultimately unsuccessful.
Yet, in 1686 both the Massachusetts Bay Colony and Plymouth Colony charters were revoked by the King James II, who was a devout Catholic, and determined to control the insubordinate Protestants in the area, and established the Dominion of New England, to rule all of the New England region (then including parts of New York and Canada).
After the Glorious Revolution, in which King James II was overthrown by William of Orange, you then get a new Protestant rule. William and Mary then created the Royal Province of Massachusetts Bay, in 1691, which created a vast colony including both the territory of the Massachusetts Bay (which included what is present day Maine) and Plymouth Colonies, as well as the holdings in New Brunswick and Nova Scotia, as well as the Islands off the coast of Cape Cod.
In the battle of independence the Massachusetts Bay Colony was a particular thorn in the side of the crown, and it lead up to the Port of Boston being shut down in one of the Intolerable Acts. Later, in 1774 the British Parliament declared Massachusetts in rebellion, and essentially revoked the charter, disbanded the government, and established a military authority over the region.
They were still considered a colony under the rule of the British Crown at this point. It wasn't up until the Declaration of Independence was ratified in Massachusetts, would then then Massachusetts Colony become an independent state. After the end of the Revolutionary War, when peace was established, Massachusetts territory was recognized, but without the holdings in Canada, which were left to the British.
However, they had no official governing doctrine until the Massachusetts Constitution was created and signed in 1780 that the Commonwealth of Massachusetts was established. That document, written mostly from notes of suggestions from John Adams, became the inspiration for how the US Constitution, and many other State Constitutions would be framed, and exists today as the longest currently functioning written constitution in the world. They then became officially one of the United States of America, when they ratified the US Constitution in 1788.
Since then, some of the territory of Massachusetts was ceded to MI, OH, ME, NY, and VT, but the area of Massachusetts has remained in tact since then.
So to sum up, the major founding acts of Massachusetts were;
- Plymouth Colony in 1620
- failed Dorchester Colony begun 1624
- Massachusetts Bay Colony 1628 (land purchase)/ 1629 (royal charter)
- Massachusetts Bay and Plymouth Colony charters dissolved 1684
- Dominion of New England 1686
- Dominion of New England dissolved 1689
- Royal Province of Massachusetts 1691 (royal charter) / 1692 (governance)
- Independence from Britain 1776
- Massachusetts Constitution 1780
- Ratification of US Constitution 1788