When a young man enters the monastery he is ordained. Before he enters the monastery the young man must be free from debt and other kinds of social obligation. He has to visit the monastery a number of times beforehand to be accepted as a potential monk.
In Theravada countries, the day before the ordination, the man walks to the monastery wearing the white robes of a layman to show his good intentions. During the ceremony he has his head shaved to show rejection of the previous life.
Entering a monastery helps a young man to follow the example of the Buddha and focus on the spiritual part of life. He casts off luxuries and focuses on the things that really matter in life.
After ordination, the monk has to live a simple life according to the Five Precepts and other rules that only monks have to follow.
He has to respect life, not steal, not lie, not have sexual relationships and not use alcohol or drugs. Many young men stay as monks for several years, becoming more mature in their attitude to life.
They then leave the monastery to get married and have a family. Many Buddhists value the monastic tradition as it shapes their character and stops them becoming too easily distracted by the passing things of life.
Some Buddhists will stay in the monastery for life in the hope that their dedication will result in them reaching Nirvana.