Name and why it is called so
The surah takes its name from the word al-kafirun in its first verse, in which the Prophet ﷺ was commanded to address those who rejected the truth and insisted on worshipping others besides Allah, and to make a declaration to them. In the hadith it is referred to by its first verse, "Qul ya ayyuhal-kafirun" (Say: O disbelievers). The Prophet ﷺ said about it that it is a declaration of freedom from shirk, and in the narration of Jabir (may Allah be pleased with him) it and Surah Al-Ikhlas are called "the two surahs of sincerity (ikhlas)."
Time of revelation and background
This is a Meccan surah, revealed at a time when Quraysh were trying in every way to stop the call to tawhid (the oneness of Allah). The commentators mention that the leaders of Quraysh offered that the Prophet ﷺ worship their gods for one year and they would worship his Lord for one year, and this surah was revealed. The chains of this report have been criticized, so it cannot be called the definite cause of revelation, but the content of the surah is certainly a decisive answer to every such offer.
Main themes
The surah opens with the command that the Prophet ﷺ tell the disbelievers plainly: I do not worship what you worship, nor do you worship what I worship. Then the same is repeated. Scholars give one explanation of this repetition: the first statement is about the present and the second about the future, meaning it will not happen today nor ever after. This also makes clear that no mixing is possible in worship between tawhid and shirk.
The last verse, "Lakum dinukum wa liya din" (For you is your religion, and for me is my religion), does not mean that every religion is valid. Rather, it is a declaration of complete disassociation and freedom: your deeds are with you and my religion is with me, and each will answer for his own deeds. The Prophet ﷺ taught that it be recited as the last words before sleep, and gave the reason that it is a declaration of freedom from shirk.