Children can be tested as early as K if teachers or parents recommend it. Qualifications before fourth grade, however, are very high. I think it's 98% on the test they give (sorry -- don't know which) as well as the various end-of-grade tests. In fourth grade, qualifications drop to 95%, so more kids get in. In K-3, it is usually a one-time per week pullout class for as little as 30-45 minutes. The class might include kids from multiple grades. In fourth and fifth grade, it's twice a week for an hour and half, and everyone is in your grade. For all grades, the classroom teacher has to list and sign-off on what she/he is doing to differentiate in the regular classroom.
In middle school, there are gifted classes in Language Arts and Math. A child might be in either or both. Requirements are like fourth grade. Language Arts is supposed to be more advanced and math works a year ahead -- eighth grade gifted does Algebra while the regular class does pre-Algebra.
In high school, it's AP and honors classes. You're supposed to have a B or better in the previous class, but it's easy to get a waiver.