To typecast someone is to repeatedly identify or represent them as a stereotype. Directors and casting agents routinely typecast actors, choosing them for extremely similar roles over and over again.
Think of the actor John Wayne, who almost always played a cowboy or a soldier. He was typecast in these stoic hero roles throughout his entire career (just try to imagine him playing a lovable clown or turning out to be the bad guy). In some cases, it's bias that causes actors to be typecast — Hollywood has only rarely cast people of color as romantic leads, for example.