From what I understand it is the top three plus the fourth places to make up the complete afternoon. There is always fear that one disappointed skater may just take the next plane out without giving the exhibition.
I think it might also depend on the venue and what they want to do numbers wise. Because I know that it was top 4 at Skate Canada this year (since Anabelle and Patrice skated) but it was top 5 at NHK (since Seb and Utako skated). So maybe it varies?
I was hoping that it would be top 5 at this one just to give Katie and Garrett the chance to participate in the exhibitions!!! Boo... hehe
Mathman, you are right about the penalty for not performing in the exhibitions. There is also a rule that says skaters are supposed to use an actual "exhibition" program, meaning they shouldn't be using their SP or LP. There is also a rule that the gold medalists are supposed to do some sort of encore. I read it in one of the various official documents that the ISU sends out. It was probably on their homepage.
I've always seen top five do the exhibitions, and sometimes the top finishers from the host country perform as well, ie I believe Belbin and Agosto performed at Worlds 2003, even though they finished 7th.