A marriage certificate is a piece of paper that says you are married. It is usually attached to the marriage license, which gives the legal names of the people getting married, their ages and residences, and often the names of their parents. The license is sworn and signed by the people getting married, and then approved and signed by a court official.
After the license is approved, then the the couple get married. This can be right after they get the license, or even a few months afterwards. The person performing the marriage (a minister, judge, or sometimes a military officer) signs the certificate of marriage, often the marriage witnesses also sign. Then the completed certificate is returned to the court that gave out the license.
An official copy of the certificate is given to the couple getting married.
In some places, you don't need a marriage license. You just live together, and tell everybody that you are married. In that case, the two of you will need to swear out a notarized affidavit that you are married, and file this with the local court. The Social Security Administration will also need affidavits from two of your friends. Some places, the court will then give you a marriage certificate. Other places, the affidavits themselves are the marriage certificate. You might have to do this if you have a common-law marriage from Colorado, Iowa, Kansas, Montana, New Hampshire, South Carolina, Texas, Utah, Washington DC, Alabama, Rhode Island, or Oklahoma. Or if your common-law marriage was from a foreign country, such as many parts of the Caribbean.