Yes, you can file as "Married Filing Jointly" if you were legally married by December 31 of the tax year. Your marital status on the last day of the year determines your filing status for the entire year.
You likely meant your W-4 form, as the W-4 is used to tell your employer how much tax to withhold from your paycheck, while the W-2 reports how much you were paid and how much tax was withheld during the year.
For more details, you can check the IRS guidelines on filing status and tax tips for marriage status changes.