Marx's theory relies on Feuerbach's The Essence of Christianity (1841), which argues that the idea of God has alienated the characteristics of the human being. Stirner would take the analysis further in The Ego and Its Own (1844), declaring that even 'humanity' is an alienating ideal for the individual, to which Marx and Engels responded in The German Ideology (1845).
Marx's Theory of Alienation is based upon his observation that in emerging industrial production under capitalism, workers inevitably lose control of their lives and selves, in not having any control of their work. Workers never become autonomous, self-realized human beings in any significant sense, except the way the bourgeois want the worker to be realized. Alienation in capitalist societies occurs because in work each contributes to the common wealth, but can only express this fundamentally social aspect of individuality through a production system that is not publicly social, but privately owned, for which each individual functions as an instrument, not as a social being:
'Let us suppose that we had carried out production as human beings. Each of us would have in two ways affirmed himself and the other person. 1) In my production I would have objectified my individuality, its specific character, and therefore enjoyed not only an individual manifestation of my life during the activity, but also when looking at the object I would have the individual pleasure of knowing my personality to be objective, visible to the senses and hence a power beyond all doubt. 2) In your enjoyment or use of my product I would have the direct enjoyment both of being conscious of having satisfied a human need by my work, that is, of having objectified man’s essential nature, and of having thus created an object corresponding to the need of another man’s essential nature. ... Our products would be so many mirrors in which we saw reflected our essential nature.'" (Comment on James Mill)
In this work, written in 1844, Marx sought to show how alienation arises from private labour, from commodity production. He argued that "My work would be a free manifestation of life, hence an enjoyment of life. Presupposing private property, my work is an alienation of life, for I work in order to live, in order to obtain for myself the means of life. My work is not my life." (Comment on James Mill)
Marx attributes four types of alienation in labour under capitalism. These include the alienation of the worker from his or her ‘species essence’ as a human being rather than a machine; between workers, since capitalism reduces labour to a commodity to be traded on the market, rather than a social relationship; of the worker from the product, since this is appropriated by the capitalist class, and so escapes the worker's control; and from the act of production itself, such that work comes to be a meaningless activity, offering little or no intrinsic satisfactions.
Alienation is a foundational claim in Marxist theory. Hegel described a succession of historic stages in the human Geist (Spirit), by which that Spirit progresses towards perfect self-understanding, and away from ignorance. In Marx's reaction to Hegel, these two, idealist poles are replaced with materialist categories: spiritual ignorance becomes alienation, and the transcendent end of history becomes man's realisation of his species-being; triumph over alienation and establishment of an objectively better society.
This teleological reading of Marx, particularly supported by Alexandre Kojève before World War II, is criticized by Louis Althusser in his writings about "random materialism" (matérialisme aléatoire). Althusser claimed that said reading made the proletariat the subject of history (i.e. Georg Lukacs's History and Class Consciousness  published at the Hungarian Soviet Republic's fall), was tainted with Hegelian idealism, the "philosophy of the subject" that had been in force for five centuries, which was criticized as the "bourgeois ideology of philosophy".
The propertied class and the class of the proletariat present the same human self-estrangement. But the former class feels at ease and strengthened in this self-estrangement, it recognizes estrangement as its own power and has in it the semblance of a human existence. The class of the proletariat feels annihilated in estrangement; it sees in it its own powerlessness and the reality of an inhuman existence. It is, to use an expression of Hegel, in its abasement the indignation at that abasement, an indignation to which it is necessarily driven by the contradiction between its human nature and its condition of life, which is the outright, resolute and comprehensive negation of that nature. Within this antithesis the private property-owner is therefore the conservative side, the proletarian the destructive side. From the former arises the action of preserving the antithesis, from the latter the action of annihilating it.
Alienation is a theme in Marx's writing that runs right throughout his work, from the Economic and Philosophical Manuscripts of 1844, to Capital - especially the unpublished sections entitled Results of the Immediate Process of Production. An online archive of almost everything written by Marx can be found at the Marxists Internet Archive- at which you can search for 'alienation'. Another good way to approach Marx's original writing is through a good collection - Karl Marx: selected writings (second edition), edited by David Mclellan clearly indicates sections on alienation in its contents. Key works on alienation include the Comment on James Mill and The German Ideology. An example of characterisation of alienation in Marx's later work (which differs strongly in emphasis, if not in actual content from earlier presentations) can be found in the Grundrisse. Marx's work can sometimes be daunting - many people would recommend reading a short introduction (such as one of those indicated below) to the concept first.