"I had a girl friend" is a sentence. "studying in the UK" is not a sentence.
So, both sentence 1 and sentence 2 are wrong.
(Not a teacher)
I agree with you that "while" is a conjunction.
However, in your case, "while" is an adverbial clause of time"(subordinator) that modifies the main clause "Ï had a girl friend".
If the sentence is paraphrased as follows, "while" is a conjunction:
I had a girlfriend while I was studying in the UK.
(Maybe I am wrong. The knowledgeable teachers here will give you a better answer.)