Deviance becomes crime when it violates rules that have been written into law and enforced by a political authority. Crime is a category of deviance.
How does deviance become crime?
Codified laws are norms that are specified in explicit codes and enforced by government bodies. A crime is therefore an act of deviance that breaks not only a norm, but a law. Deviance can be as minor as picking one's nose in public or as major as committing murder.
When deviant behavior is considered a crime?
Deviant behavior may violate formally-enacted rules or informal social norms. Formal deviance includes criminal violation of formally-enacted laws. Examples of formal deviance include robbery, theft, rape, murder, and assault.