Dharma, artha, kama and moksa are the four purusarthas, the four aims of life.
The first of them, dharma, is a lifelong objective. "Dharma" means essentially bringing everything within certain limits, under a certain discipline.
Bhagwan declares in the Geeta: "Sarvadharman parityajya mam ekam saranam vraja" -Give up all inquiry into dharma and adharma. Go beyond. dharma is always a part of man's life. When he reaches a high spiritual state, he may not be conscious of it, but dharma will abide him and will keep shining as a light in all that he does.
The pursuit of artha (material welfare) and kama (desire, love) must be given up at a certain stage in a man's life.
Artha, must be based on dharma. The householder's stage of life commences with marriage. In it both material well-being and desire have their source in dharma. Grhasthasrama, is a bridge between the two and in it both are permitted within the bounds of dharma.
Kama must be inspired by dharma, step by step, the desire will lose its keenness and eventually one will graduate to sannyasa.
A man needs money and material goods to live in this world. As for kama or desire, it is needed so that children may be born according to their past karma. It would not be practical for all people in this world to become Sanyasi. The sastras give importance to householders as the backbone of the society since they live and allows others to live.
After completing one's student-bachelorhood and acquiring learning and good qualities, one must marry so as to perform religious rites and live a life guided by dharma. Marriage is included among the forty samskaras, which fact shows that it is a sacred rite that sanctifies life. Just as upanayana is preliminary to the student-bachelor's stage of life, marriage is preliminary to become the householder. Its purpose is disciplining the senses and perform various duties.
Moksha is the liberation from rebirth or samsara. This liberation can be attained while one is on earth The samsara- human life as bondage to a repeated process of rebirth, release from this cycle, the suffering involved in this cycle is also ended.
Moksha is attained by disidentification with the body and mind, which are temporary and subject to change, and realization of our true identity.