So there are a lot of similarities between the formal dress and the cocktail dress...the fitted bodice, the fact that neither of them is made of pure cotton (though there may be some exceptions to that on the cocktail dress' side of the equation), can both be worn to black tie, creative black tie, or black tie optional gatherings, etc. There are, however, some key differences and cocktail dresses and formal dresses do vary in a few ways.
Cocktail dresses are worn at cocktail parties (of course) and semi-formal occasions, while formal dresses are worn at formal occasions. The length of a cocktail dress can be either down to the knee or all the way to somewhere around the ankles, with the particular length of about two inches above the ankles being called "tea length." Formal dresses tend to be down to the ankles or lower, though they can be tea length or shorter with the right design. Cocktail dresses tend to be made in lots of subdued colors (hence the "little black dress" phenomenon in fashion, for example, since black can be so subdued it's nearly dead), while the formal dresses tend to be in more commanding colors, such as jewel tones or bright colors.
Formal dresses are also made of thicker materials than cocktail dresses. Cocktail dresses have usually been made of very light silk or wool, for example, whereas formal dresses have heavy components, such as taffeta and velvet.
Not to mention that formals can still be worn at different times than cocktail dresses. For example, a semi-formal gathering would require a cocktail dress or a tailored dressy suit and not a formal dress at all. However, you would not want to wear anything less than a formal dress to a white tie event.