In accordance with the current Criminal Code of the Republic of Kazakhstan, the most severe punishment in the system of measures of state coercion applied to a person found guilty of a crime is imprisonment. There is an opinion in society that the application of punishment to a certain term or life imprisonment is one of the main ways to achieve the goal of punishment. The characteristics of the application of the measure of coercion also have a direct impact on the conditions of serving the sentence and the social environment of the defendant. In most cases, in conditions such as a penitentiary institution or a change in its order, the main factor in committing an intentional serious crime is a violation of the personal qualities of convicts aimed at ill-treatment. Deprivation of liberty has a strong influence on a person, especially on a defendant who has fallen into this type of punishment for the first time, contributes to the restoration of social justice, and the prevention of new crimes. At present, the criminal law policy adheres to the principle of humanism and this regulates the trend towards a decrease in the facts of causing deprivation of liberty by victims of criminal law repression. The author proposes in the article the criminological aspects of serving a sentence of imprisonment, the personality of the offender and the features of his resocialization, as well as ways to improve the penitentiary legislation. Key words: deprivation of liberty, defendant, penitentiary institution, penitentiary system, punishment, criminopenology, principle of humanism.