They can simply "Do Homework" on their own, "Do Homework With..." another friend of their age group, or "Get Help From" an older Sim on the lot.
If possible, they will put the assignment on or by a desk, and seem to prefer the first desk that was placed in the house, even if it is in an illogical or inaccessible location.
If a student has unfinished homework, he or she will put the new homework on top of it.
This will fulfill the "Ask for Homework Help" want, and will allow them to do homework more quickly in the future.
If Seasons is installed, students will do homework faster in the fall, or after drinking apple juice.