While the person is incompetent, s/he cannot be put to trial on any charges. When they are returned to competency, generally by medication, then they can be tried. This is not the same as insanity. If a person is insane at the time that they committed an offense, then they are found not guilty by reason of insanity. Competency means that they do not understand what is going on, generally, and that they cannot help their lawyer with their defense.
Although I have answered the question to try to help you, you should consult with a lawyer in your area in person on the matter. In addition, my answer does not establish an attorney-client relationship between us.
So long as an individual is incompetent the case against the person cannot proceed. There is generally a statutorily provided for period of time in which the state has to have someone made competent by way of treatment. This period of time may vary from state to state; in Michigan for example the statutory provided period of time is 15 months. If the person cannot be made competent during that period of time the state is precluded from prosecuting that person. If they are made competent during the provided for time period than the criminal prosecution picks up where it left off.
the above responses are correct, if determined to be incompetent for trial, the person will be evaluated and with either medication or therapy it will be attempted to return them to competency. At such a time, the person will then be tried for the offense. This is not the same as insanity.