The University of St Andrews ______ is the oldest university in Scotland.
A. which was founded in 1413
B. , which was founded in 1413,
C. , that was founded in 1413,
The answer is 'B'.
I wonder why 'A' is wrong?
Without the commas, the "which" becomes a restrictive clause: it's there to tell you which University of St. Andrews the sentence is talking about, i.e. it's implying that there is more than one such university. Since that's presumably not true (there's only one University of St. Andrews), you have to put in the commas to make the "which" part into a simple non-restrictive subordinate clause, i.e. one that's giving information that is parenthetical to the main sentence - the sentence could exist perfectly happily without it.
('C' is incorrect because "that" doesn't like to be subordinate like that. You can sometimes get away with it in colloquial, informal speech, but most teachers would frown on it.)
I think many non-native speakers don't know the definition of the relative defining and non-defining clauses. So I have tried to explain these clauses in simple words along with my reply although a satisfactory answer has already been given by Martha.
The university of St Andrew is the oldest university in Scotland.
This sentence is a complete sentence on its own. Anybody can understand its full sense; we don't need any information essential to know which university is being talked about. It's already mentioned in this sentence. If any information is given after the name of the university St Andrew, it'll be an additional information. For this additional information consisting of which + a verb we need to put a comma before and after this information. This clause giving the additional information is called the non-defining relative clause.
In light of this explanation, the first option is wrong as there are no commas before and after the additional information "which was founded in 1413".
As for the second option ", which was founded in 1413, "is correct because it fits in the explanation given in the first paragraph. It has all the characteristics of the non-defining relative clause i.e. additional information, along with use of "which" at the beginning of this clause and commas before and after this clause.
Regarding the third option, it's also wrong. Two commas are there but "that" has been used instead of "which" used in the non-defining relative clause.
Now look at the following sentence:
The university is the oldest university in Scotland.
This sentence is also complete but if the listener/reader doesn't know which university is being talked about, this sentence does not give the full sense required unless some information essential to understand the full sense of the sentence is provided. The defining relative clause contains this essential information for which we don't use commas before and after it and we use "that" at the beginning of it for things and persons. We can also use "who" for persons and "which" for things. This clause giving essential information is called the defining relative clause. We can put the above sentence with the relative defining clause as follows:
The university that/which is called the university of St Andrew is the oldest university in Scotland. "That is called the university of St Andrew" is the defining relative clause".