Where I have been (in the US), work done for a course is always owned by the person who is paying for the course, which in the case of an undergraduate paying their own tuition, is the student.
Basically, the person paying owns the work. If you pay, then you own it.
This depends on what the work's being done for. If it's for a class or a credit giving research project, the university usually does own the IP in most cases.
However, if it's a side project that's not using any of the university's resources, the university shouldn't have any rights to it.