Croatian, Serbian, Serbo-Croatia, Croato-Serbia and South Slavic dialect continuum
This is not an easy subject to explain (from experience) properly, especially to people who live in countires or are part of populations which do not use language as one of, if not the most important signifier of their identity. Here I mostly think of people living in the Anglophone world, who also make the majority of this forum.
In additions there is a still ongoing lingusitic debate of what is a language and what is a dialect and I can't see that ending anytime soon so that coplicates matters further.
Officially Croatian and Serbian languages are separate languages because the institutions of Croatia and Serbia had declared it that way. It is the same thing with Slovenian, Bosnian (though sometimes Bosnian is divided into Bosniak, Croatian and Serbian subvariant when the later two are not counted as part of Croatian and Serbian), Montenegrin, Macedonian and Bulgarian.
The official languages are standard forms agreed on by lingusits and imposed by the government through education and administration and are almost unviersally not used as a living languages by the populations in named countries.
Stretching from the Alps to the Black Sea is a curious little thing called the South Slavic dialect continuum made out of numerous dialects and maybe a few languages.
As far as official Croatian and Serbian languages are concerned they are quite similar as far as grammar and vocabulary are concerned but the speaker of either will instantly know if his corespondent is usining the other language. The Croatian language is somewhat grammaticaly more complex and may at times sound more embelished or antiquated while the Serbian language is more simpler both to speak and to learn. That fact has scientificaly been recorded that 9/10 speakers of "Croatian" will start adopting "Serbian" way of speaking if put in a "Serbian" surounding while the opposite is only true for 3/10 of speakers of "Serbian". In a way the "Serbian" language is naturally more resilient that "Croatian" due to its slightly greater simplicity, in a similar way the super simple English language is easier to learn and use than say Hungarian. At the moment official Croatian and Serbian languages share between 70-75% of their vocabulary but the similarity that has been achieved as well as the more recent separation have been mostly artificial.
Prior to the codification of the official Croatian and Serbian languages in the 19th century there was a hodge-podge of dialects/languages/speaches(sp) spoken by south slavs identifing themselves as either Croats or Serbs (Further in text Croatian/Serbian language, will be used to denote the language of the state and Croat/Serb language will be used to denote what is spoken by Croats/Serbs). So any form spoken by a Croat was considered as Croat language and the same went for the Serbs.
To add to the confusion prior to the 19th century the name of the language spoken in these parts was variously called Slavic, Dalmatian, Croatian, Serbian, Bosnian, Slavonian or Illyric by both foreign and local lingusits and historians. It wasn't until 1824 when Grimm named the language Serbo-Croatian for the first time.
There are two pople most responsible for the "problem" we have today, Vuk Karadžić and Ljudevit Gaj. As far as I am concerned these two guys are both heroes and villians and I can't quite decide which they are more. They were the leaders of movements in creating the Croatian and Serbian languages from the various Croat and Serb speaches.
At the time people who identified themselves as Croats spoke 3 main dialects, 4 yat variations and were using 3 scripts while the Serbs spoke 1 main dialect, 1 transitional dialect, 4 yat variations and were using 3 scripts.
It is important to note that the main signifier of a dialect is what word is used as the "what" word.
Kajkavian > Kaj = What
Kaj = Kej = Ke = Kae = Ce (sub-dialects)
In addition Kajkavian is used exclusivly by Slovenes
Chakavian > Cha(Ća) = What
Ća = Ce = Će (sub-dialects)
Exclusivly used by Croats
Shtokavian > Shto(Što) = What
Štao = Šta = Šte = Šće (sub-dialects)
In addition Shtokavian in the forms of Što and Šta is used by Bosniaks and Serbs
Then you have 4 yat variations
Ekavians = yat is writen as "e" used by Cr/Sr/Bo/Sl
Ikavian = yat is writen as "i" used by Cr/Sr/Bo
Jekavian = yat is writen as "je" used by Sr/Bo/Sl
Ijekavian = yat writen as "ije" used by Cr/Sr/Mn
And the scripts used were Latin, Cyrilic(3 variations), Glagolitic and Arabic.
So to get back to the story.
Mr. Gaj was born in the region of Croatian Zagorje which is north of Zagreb in modern north-western Croatia. His birthplace is the town of Krapina, his parents were German immigrants (
) and he grew up in an area where Croat identity was particulary strong and the language he grew up with was called Croat by the locals yet it was only one of the variations, in his case the Kajkavian-ekavian variant using Latin script. Later in life when he started working on creating a standard Croat/Croatian language the form he first codified was naturally the one he grew up with and that was spoken by the majority of people identifying themselves as Croats under rule of Croatian Parliment at that time. But that codification failed to gain traction because majority of people that considered themselves Croats did not use the form his was championing, while at the same time Slovenians were. So he decided to codify the Shtokavian dialect as the standard Croatian language. Who knows but had he persisted I am quite sure the question posted above would have been "how close are are Croatian and Slovenian languages really?" instead of the one that was asked. To add to the confusion his Croat identity was not particularly strong and he often identified himself as an Illyrian first and Croatian second (when he added that part which was not often).
On the other side we have Mr. Karadžić born in Loznica where the Štakavian-ekavian writen in Cyrillic was used but his parents originated from central and eastern Montenegro where a different form was spoken and sometimes writen. He started codifing the Serbian language based on the dialect spoken in eastern Herzegovina that was Štokavian-ijekavian writen in both Cyrillic and Latin script.
That to the whole picture comes the so called Illyrian movement that tried to politicaly, culturally and linguisticly unite the south slavs living in the Monarchy, Ottoman empire as well as principalities/kingdoms of Montenegro and Serbia. Though often being persecuded by the government in Vienna that same government saw them useful when they decided they wanted a single literary language for Croats and Sebs and maybe Slovenes for administrative purposes.
So in 1850 Slovene philologist Mikolšič initiated a meeting in Vienna between leading Illyrian and Serb lingusits. There they agreed to create a unitary language made from two bordering dialects the west and east Herzegovinian Štokavian-ijekavian dialects, the western form would be the basis of Croatian and eastern form would become the basis for Serbian standard language, imediatly puting the basis for a far greater similarity that existed on the groud among the people that spoke Croat and Serb language. And a new language was born, the Serbo-Croatian that had very little support in the situation on the ground.
Later in time during the first and second Yugoslavia there were movements to bring the two languages even closer together which resulted in opposition mainly from the Croats (though there was resistance on the Serbian side). Most of the Serbs speak a form of Shtokavian and it wasn't as difficult for them to adapt to the standard form on the other hand though Kajkavian and Chakavian Croats have accepted Shtokavian as the standard language form for the sake of Croat unity they were uncomfortable with further closenes between standard Croatian and Serbian because that meant accepting not only a dialect not of your own but also a language you considered foreign. Not to mention the political pandemonium that created further frictions. The Ustaše '41-45 language purism did more harm than good and the reversals just further faned the flames.
So to cut my wall of text short the standard Croatian, Serbian, Bosnian and Montenegrian I could on a purely linguistic basis call the same language, because they were made to be that. But I can't say that the Croat, Serb, Bosniak and Montenegrin language are one and the same, some spoken forms are very close to each other while others could be a world apart. In addition as far as south slavic dialect continuum is concerned the mutual intelligibility can't be used as a mesuring tool since we(as in speakers of one diealect or sub-dialect) understand words we do not use.
So I know the standard Croatian, I speak Kajkavian ekavian/ijekavian and Šćakavian-ikavian, but also know great many words used in other dialects/forms that I do not use in my speach.
As far as I am concerned the standard languages that were created in the 19th century are a form of culturocid for the purpose of birocratic efficiency that only causes resentment. As to the question what is a Serb or Croat language I say "whatever form any individual person uses that identifies himself as a Croat or Serb".
Angel Heart and I think Halagaz could better anwser about the situation in Serbia/BiH but in Croatia virtually no one uses the standard form outside certain parts of eastern Slavonia (it was heavy settled from western Herzegovina) and official document. So when a person goes to elementary school it can be quite a shock, almost like learning a foreign language. For the Shtokavians not so much, but for Kajkavians and Chakavians it is quite a stres and it has been observed for decades now that people in areas where Kajkavian and Chakavian are spoken have considerably worse grades in Croatian language than in Shtokavian areas.
I hope this was understandable