The original concept of the carbine was effectively the weapon of a carabineer - which was like a knight in shining armour - but instead of using a lance, his primary weapon was a carbine. It was shorter that the usual arquebus or musket, probably because that'd make it easier to reload and handle on horseback.
From then on, carbines were reguarded as weapons specifically intended for use on horseback, a cavalry weapon. When most militaries in the world began to phase out horses to make way for armourd tanks, carbines were by then known as a shorter-than-usual rifle, intended for cavalry, which were now tanks, not people on horses. Then sub machine guns were favoured over rifles because they're smaller...so no longer was the carbine a 'cavalry weapon'.
Nowadays, the US military - the Army in particular - has decided to use the M4A1 carbine as the main assault rifle. A weapon in the same category as a rifle, being derived from a longer rifle design (M16) but shorter, so fitting into the carbine category. People refer to it as an assault rifle, and a carbine. It is both
So if my waffling on has bored you to tears
in short a carbine is just an assault rifle that is shorter than the usual - barrel length shorter than 20 inches, like most have already stated.
Seeing that the definition of the word 'carbine' has changed significantly over the course of history, I think it's a pretty flexible term