When purchasing photos from a gallery.
You can add additional fields to be filled in at checkout (like for a students name) in your Price Lists in the Photo Products section.
Click the "edit settings" link for your price list and you will see the option to create additional fields.
When pre-selling packages
If you are pre-selling packages, you can create options for this in your pre-sell product by clicking Options and creating a text field option. (Also see setting up a section for pre-selling packages).