I've heard that many people use "Kollege" to call their friends in college/university (instead of colleagues), even when they don't have jobs. It seems to mean something like "university-mate". I was told it may be a cultural thing. Is "Kollege" actually used as "schoolmate" in university/college?
The use of „Kollege“ in a non-work environment is colloquial and indeed means something like „friend“ or „someone I hang out with“. It is usually not as strong as „Freund“ but depending on the speaker it can be.
There are theories out there that say it established as a cooler way to say „Freund“...
This usage of the word seams to have been established around 2005-2007 (or even earlier as mentioned by Philipp in the comments) as you find the first questions about it in that range. It was first used by youths.
From my experience I can say that these youths from 10-12 years ago still use the word with that meaning as I have kolleagues at of that age at work who do that
To make this answer complete I‘ll add a suggestion from the comments (thank you @GittingGud): for addressing people that take the same courses at university there is another german word: Kommilitone. But usually this word is not directly assiciated with „friends“ at the universary. Although a Kommilitone might be your friend, not all of them will necessarily be.
Just to add another facet: Depending on the pronunciation "Kollege" can also be used as a warning to the guy facing you to behave better... Usually this is used by policemen or bouncers at clubs like:
He "Kollege", pass auf was Du sagst / tust
The person called "Kollege" in that case is for sure NOT your friend and instantly knows: this is getting serious... better back off...
In Germany, the term Kollege is used for coworkers. The term using people who study together with you at the university is Kommilitone ("the one who is fighting together with you", from latin cum "with" and militio "fighter", miles "soldier")
According to a comment from rexkogitans, in Austria, Studienkollege seems to be the standard way of referring to persons which would be called Kommilitone.
In Switzerland, Kollege is also used to denote any persons who you have contact with and who are not so close to be called friends, including your classmates in school. So in Switzerland, Kollege could also denote what in Germany would be called Kommilitone.
If you call your university friends Kollege in Germany, this would be stretching the meaning of the word a bit by using a pretty close analogy, so it would probably be well understood.
So, maybe you have heard this in more international, Swiss or Austrian contexts or you are facing a phenomenon of language at change. I don't know any data about this potential change and I also didn't recognise this use of Kollege myself. But I can easily imagine that the more formal and seldom word Kommilitone which might bear some elitist associations, could be replaced by Kollege, because this is the word more well-known from other contexts. So it would not be much of surprise if Kollege would start to replace the somewhat old-fashioned Kommilitone (which is, by the way, also hard to spell for many.)
The "original" term is still Kommilitone though.
For university friends
(ehemaliger) Kommilitone translating to (former) fellow student
is mostly used. For earlier phases I see not many alternatives to
Kollege is typically not used for that, but a common addressing within trade unions.
At least as the composite word Studienkollege, it is a very common word to refer to someone who studies/studied at the same time at the same university.
The word Kollege alone is usually used to refer to coworkers.
From my experience Kollege can also be used in an informal way much like buddy ("Kumpel" / "Kamerad"), e.g.
ich war gestern mit ein paar Kollegen im Kino
does not necessarily imply being coworkers.
As the user rexkogitans stated before, Studienkollege might be a suitable word for someone studying at the same university.
Kollege is a common term for people you won't hang out with unless forced to do so. They are part of your work environment, nothing more.
There are however some colloquial meanings:
He, Kollege, da gehört dein Anhänger aber nicht hin!
A groundkeeper in a trailer park giving directions. He's slightly annoyed but using du, aber and Kollege keeps a middle ground between strict orders and a friendly reminder.
Kollege! ‹bear hug follows›
Using it to address friends means you are mocking them.
You may even use it for things you work with.
Dieser Kollege geht nicht ab. ‹pointing to a bolt›