The short answer is when the child turns 18 years.
There is a persistent myth that at age 12, a child can change custody based on the child’s preference.   Florida law does not allow a child to pick a custodial parent at a certain age.  Obviously, once  a child is turns 18, and is an adult, the adult child is free to live where he or she wants.
One of the many factors the Court may consider in child custody cases is the child's preference taking into consideration the age and maturity of the child.  Section 61.13001(7)(d), Florida Statutes.   But this just one of many factors the court may consider.