This is an excellent question. Both concepts are examples of social stratification. In my mind, the primary difference between them is that "class" is based primarily upon material acquisition or the lack of it, while "caste" can be based on such a premise but is more of a traditional notion of hierarchy. Members in a particular "caste" share certain values or operational definitions of the good. For example, in India, the definition of the "Brahmin" caste is more than economic, and is based on common beliefs and practices. When the term "class" is used, it is linked through the primary notion of wealth or status, and does not carry with it the traditional concepts that caste does. Both are forms of social segregation and stratification, but one is more ushered in over time while the other is a relatively modern construct predicated upon wealth and the prestige associated with it.
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.
It can be said that a society divided into castes is more rigid than a society divided into classes, being a brake in the path of economical, technological, social changes.
However, many companies have formed groups like castes. For example, in feudal society, upper classes (aristocracy, clergy) were distinguished by isolation and relevant lifestyles only to their classes, producing impermeability and lack of social mobility channels.
The castes division was codified by the Brahmin, around 1000 BC.In the top of hierarchy, was Brahmin caste, which was dedicated to religious and intellectual life, fulfilling the ritual sacrifices, transmitting and commenting on the teachings of the Vedas. They were identified with the sacred and represented priests caste. It was the second caste of warriors, kshatriya, which had the primary duty to fight and lead armies. After two elite ruling castes, vaishya caste resulted, consisting of large and small landowners, merchants, etc. Last caste, Shudra, was composed of peasants and craftsmen.
Social class is a form of stratification in which the affilliation to different social groups and relationships between them, are determined primarily by economic criteria. This type of stratification, typical of modern societies, is not involving the automatic transmission of hereditary privilege.
Other forms of stratification works on the basis of religion (caste system) or according to some hierarchy of prestige (pre-modern systems structured on group status), both systems being formally institutionalized and governed by hereditary transmission of social positions (together with all powers they imply).
Castes and classes both refer to grouping of people in a society. However, the world class is is for groupings that may be based on many different criteria. Thus classes may be based on various criteria like economic status, profession, political status, and religion. In this way we can say that caste is one of the ways in which classes may be grouped.
Caste is a grouping that is based on primarily on heredity or birth. People from a caste generally share a common culture. This term is used most often with the system of caste that exists in India. According to this division of classes, the whole society is divided in four broad castes named brahmin, kshatriya, vaishya, and shudra. These castes are divided in many other sub-castes. Generally people from a caste marry within their caste.
The Caste system is known in India (Hinduism) to separate individuals based on how their families are valued in society. In the caste system it is difficult to those persons born into the lower caste to move into the higher caste. Whatever caste they are born into will become their lineage.
Class is different because individuals from diverse backgrounds and socioeconomic statues can move into a higher income bracket or social class based on skills, education, and networking abilities.