Do I file a joint return for the year in which I got divorced?

Marital status is determined by your status on the last day of the year. If you are divorced on December 31st of that year, the IRS considers you to be single for that entire year. If you are legally married on December 31st, the IRS considers you to be married for that entire year. You can only file a joint return if you were legally married on the last day of the year.