The Wiki speculates that stars are held in place magnetically.
I don't believe it is ever specifically stated, but I believe that the stars are most likely held in place by the same technology that allows the Commander's Hooks to function.
The Hooks allow the army commander to move freely throughout the Battle Room during practices, and also allows the commander to unfreeze the suits of his army members during practice.
The Hooks do not function during actual Battles, so the school administrators clearly have quite a bit of control over the technology.
In the movie, Graff is shown using using his Hook to move the students, bringing them from various free-floating positions within the zero-gravity area, to a formation hovering in front of him.
It isn't much of a stretch to imagine more powerful versions being used to position the stars, and then to hold them in place during a Battle.