Both are correct. If the reference is to studying or being a student, leave out the article: I met my wife while I was studying at university. In other cases, use a or the: Get off the bus at the university.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.