Sources connected to the singer tell TMZ ... there has been no firm decision on the precise length of time Brown will stay, but everyone in Brown's camp -- including Brown himself -- is open to as much as 3 months.
One source put it this way ... "The rehab facility has been told to take him [Brown] apart and put him back together."
As TMZ first reported ... Brown is specifically getting treatment for his anger problem, which manifested itself last weekend when he was arrested for allegedly punching a guy in the face.
And, as we previously reported, Brown's lawyer, Mark Geragos, knows it's very likely the judge in the Rihanna case will revoke Brown's probation, which could put him behind prison bars for up to 4 years. The rehab move is an act of good faith, showing Brown is dealing with his problems.