Insanity pleas are quite unusual despite how much Hollywood may try to make you believe they happen all the time. Each state has different rules for how the plea works.
According to CBS Miami, an insanity plea in Florida can result in you not having to serve any time in prison.
How it works
What happens instead is that you go into a treatment facility for the mentally ill. Once you receive clearance from doctors that you no longer suffer from the mental condition that led to your criminal charge, you leave the center and reenter society.
In most cases, you would use this plea if you were guilty of the criminal charges against you. You admit guilt but reason that you could not understand what you did or respect the severity of the crime due to having a mental disorder or illness.
The most common situations in which people use this plea is in a murder case.
Those who oppose this type of plea state that it is not adequate for ensuring the safety of the public. Since you may only serve a short time in the treatment facility, it is not the same as the punishment for the crime.
The deepest concerns are with those who commit murder. The prison term would be many years behind bars with the potential for life behind bars. With an insanity plea, there is a the potential a murderer could be free in only a few years. Due to these concerns, judges do not often rule in favor of such a defense.