consider an arbitrary continued fraction, do we have an theorem about its convergence or conditions about converging?
the question is came from examples like $$ x=5-\cfrac{6}{5-\cfrac{6}{5-\cfrac{6}{\ddots}}}$$
which $x$ can be both $2$ and $3$ ! I think there is special conditions that make it to converge to one of these numbers. it will be great if you help me with this. thanks a lot.

As Will already explained, the answer in this case is 3. As a matter of fact if you take almost any number $x$ and define sequence $(a_k)$ by the following rules $$ a_0 = x,\ a_{k+1} = 5 - \frac6{a_k} $$ then it converges to 3. In the case of our continued fraction we have $x=5$ and you can prove (it is quite easy) that $b_k = a_k-3$ is positive and monotonically decreasing, and not just decreasing but doing it pretty fast -- $b_{k+1} < \frac23 b_k$ -- from which it immediately follows that the limit is 3.
Similar methods can be applied to many other generalized continued fractions of the same type $$ a_k = p - \frac{q}{p-\frac{q}{p-\frac{q}{...}}} $$ but perhaps you would like to explore that by yourself. Good luck!