There are three main classifications of swords: shortsword, longsword and greatsword. There is debate as to whether the rapier counts as a fourth class or as a subdivision of longsword.
Shortswords are generally no longer than about 24 inches (about 60cm), with the hilt the sword as a whole will be from top to bottom around 30 inches at most. Whilst length is the main physically defining difference between the shortsword and longsword, it is the way they are fought with that truly separates the two. The shorter swords allow for a more forward-thrusting attack opposed to the longswords arcing slash that rely on momentum and flow. Shortswords are more agile but typically do less damage as a result.
Longswords are longer than 60cm, but can still be wielded in one hand. Due to the extra weight and length shifting the centre of mass, short stabbing actions are not as easy to execute with a longsword. As aforementioned, the longsword is utilised in a slashing manner usually. A true master of a longsword, though, is mesmerising to watch, with each attack seemlessly flowing into the next.
The rapier is comparable to a longsword in length, which is why there is debate regarding the classification of the rapier. The rapier differs from a longsword by typically having a narrower blade, allowing for more agile and dextrous movements with the weapon. The lower weight also allows for attacks of a more thrusting nature, more akin to the shortsword. This is the argument used for giving the rapier its own division, as whilst in the length dimension it compares to a longsword, how it is utilised compares to a shortsword.
Essentially a larger longsword. Unlike the other classifications, greatswords are designed to be wielded two-handed, forgoing the ability to dual-wield or carry a shield.