The first thing to do is to talk to the course professor, the department, or the university's legal department. Some universities have restrictions on what you can do with coursework. In some cases, you give up all rights to the work, meaning that you do not own it and you can not do anything with it. This varies by university, and sometimes even department. In addition to legal issues, if this is a common project, there might be academic dishonesty repercussions with releasing a project done for a course. Of course, only someone from the university can answer these questions.
Assuming that you are allowed to release your program, the next thing to do is to choose a license. If you release the code, you really should apply some license to it. This license would tell people what they can and can not do with the source code in terms of using, modifying, and redistributing (among other things). It also can release you from liabilities if the source code is used improperly and causes some kind of damage.
There are many questions here on Programmers about choosing the appropriate license, so I'm not going to go into all of your options. There are a lot out there. You should consider using one of the existing licenses rather than inventing your own. Existing licenses have been carefully written and (usually) reviewed by people with a legal background - these are things that are more likely to stand up when challenged.
Once you choose a license, you just make it obvious which one you have. Usually, this includes including a LICENSE file in your release that includes the full text of the licenses. Often, individual source files will also contain a line that identifies the copyright holder and the license under which the copyright holder has released the code.