An institution is a collection of shared expectations about such long term public habits. Institutions encourage the development of roles, or collections of habitual behaviors that are associated with and expected of individuals who are acting in an institutional capacity. When a person assumes a role, he or she adopts these habitual behaviors, and we interact with him or her as part of the institution rather than as a unique individual.
As an example of this, consider our society's collection of habits that have to do with right and wrong - that we should not injure other people, that we should not steal, that we should stop at red lights, and so on. This group of publicly shared habits makes up the institution that we call the Law. As an institution, the Law incorporates many roles including, for example, police officer, judge, lawyer, victim, prisoner, guard, and so on. When we interact with people in any of these institutional roles, we treat them according to our shared expectations of the role.
Thus, if a police officer pulls you over on the highway, you behave towards each other as your two roles require. If instead you had met "unofficially" at a party or while shopping at the mall, your relationship would be very different.
Because they establish behavioral rules, institutions provide societal control. However, if this control is to persist over time, then each new generation of children must be trained to participate in the institutions of their parents. Thus, institutions are legitimized and maintained by means of tradition and education.
Eventually, some institutions become reified - that is, the members of the society forget that the institutions are human constructions, and they begin to relate to them as if they are natural objects. In this way, we create social structures that seem as real to us as the reality the "natural" world.