This is a good question, and one that has received a lot of attention in the contemporary era.
Classically, many Muslims held that death is generally the punishment for apostasy (with some exceptions and conditions). Some Muslims today see this more in line with a modern treason law. That is, today, while killing someone for apostasy is considered a violation of human rights, killing someone for treason against their own nation is considered acceptable. This is because, in the past, religion was a primary marker of public identity and deliniation of the state; whereas, in the modern world, religion is considered a private matter and a matter of personal belief, and national identity is considered primary.
Also, this law is based on hadith. Some people have challenged the authenticity of hadith that say this, because it seems to go against the Qur'anic view that there should be no compulsion in religion; it also seems unusually harsh, since the Prophet had a merciful and lenient character. Other people hold that it may have been appropriate in the time of the Prophet (where leaving the Muslim community would generally mean militarily aiding the enemy) but it is no longer valid today.
So, basically, one can say that, yes, this is a classical view; but it is still a subject of much discussion.
Also, note that even if the classical law is correct, it is not acceptable for a person to go around killing people because he or she thinks they are apostates.
There are a number of pieces on this on al-Islam.org, which you can read by going to Google and typing "apostasy al-islam.org".