Generally, how long you stay in a drug rehabilitation center can be released, depending on the size of drug addiction, and you must completely quit gambling before you can be released.
Legal basis:
People's Republic of China (PRC)'s anti-drug law
Article 39 If a woman who is pregnant or breast-feeding a baby under one year old is addicted to drugs, compulsory isolation for detoxification is not applicable. Minors under the age of 16 who are addicted to drugs may not be forced to be isolated for detoxification.
For drug addicts who fail to implement compulsory isolation and detoxification in accordance with the provisions of the preceding paragraph, community detoxification shall be implemented in accordance with the provisions of this Law. Urban sub-district offices and township people's governments responsible for community detoxification shall strengthen assistance and supervision, and urge the implementation of community detoxification measures.
Article 47 The term of compulsory isolation for drug rehabilitation is two years. One year after the implementation of compulsory isolation detoxification, after diagnosis and evaluation, for drug addicts with good detoxification effect, compulsory isolation detoxification places can put forward opinions on lifting compulsory isolation detoxification in advance and report them to the decision-making organ for compulsory isolation detoxification for approval. Before the expiration of compulsory isolation detoxification, after diagnosis and evaluation, the compulsory isolation detoxification place shall put forward opinions on extending the detoxification period for drug addicts who need to extend the detoxification period, and report them to the compulsory isolation detoxification decision-making organ for approval. The period of compulsory isolation and detoxification can be extended to one year.
Article 27 of the Regulations of People's Republic of China (PRC) Municipality on Drug Addiction Treatment shall have a term of 2 years, counting from the date when the decision on compulsory isolation treatment is made. Persons who have been forcibly isolated from drug rehabilitation centers by public security organs shall, after three months to six months, be transferred to compulsory isolation drug rehabilitation centers of judicial administrative departments to continue compulsory isolation drug rehabilitation.