Encyclopedia Britannica defines caste as
any of the ranked, hereditary, endogamous social groups, often linked with occupation, that together constitute traditional societies in South Asia
From this definition, we can see the ways in which class and caste differ.
The major difference between caste and class is that caste is almost a genetic idea -- it is something that is passed down from generation to generation automatically. By contrast, a person's class may be very different from that of his or her parents. Caste is automatically hereditary, class is not.
A second difference is that castes are "endogamous" -- which means that people from one caste may not marry outside the caste. While it is often true that people of one class marry inside that class, there is no rule that says they must, as there is with caste.
Finally, please note that the word "caste" is not used very often to describe any societal groups other than those of India and some other parts of South Asia.