What is the rule about articles when it comes to abbreviations? Let’s say I have a noun der Professor (for a female it would be die Professorin, but that is irrelevant here). I would like to use abbreviated form — would I get der Prof. or just Prof.?
The article is determined by the abbreviated word (der Prof.), or the main/last word in a compound (die NATO, der EuGH, etc.)
When the abbreviation becomes a word in its own right, so to speak, the article is often dropped (AIDS, not das AIDS).
It depends on the circumstances.
If you are addressing somebody, e.g. in a letter or an email, there is no article in the first place. It would be Herr Professor Mayr or Hr. Prof. Mayr — although the latter is typically not acceptable at all. (‘If you’re going to write it, have the decency to write out the title’ is the general rule.)
If you are writing in a text where an article is required, it will of course still be there and determined by the word in question.
Der Prof. besucht die Einrichtung.
Die Prof./Prof.in besucht die Einrichtung.
However, I would still argue that that is an unlikely case. If you have the need to abbreviate, you may just want to go all the way:
D. Prof. bes. d. Einricht.