"Declare" means to annouce, to let people know.
When talking about university "declare your major" means to decide what your major will be, and to tell the university. Before you have declared your major, you can study different subjects to help you to decide what area you are most interested in.
I am fairly sure this is used in American English but not in British English, because Americans have a different system for university. Please correct me if I am wrong.