거 is a spoken form of 것 which means means "thing,fact,situation,it"
"는 거였어요" is past tense of "는 거예요"
verb stem+는 거 is present tense of modifier
verb stem+(으)ㄴ 거 is past tense of modifier
이 사과는 그가 먹는 거예요. This apple is that he eats.
이 사과는 그가 먹는 거였어요. This apple was that he used to eat.
이 사과는 그가 먹은 거예요. This apple is that he ate.
이 사과는 그가 먹은 거였어요. This apple was that he have ate.
그 전화 그한테 온 거예요. It is that the phone call was for him.
그 전화 그한테 온 거였어요. It was that the phone call was for him.
이 전화 그한테 오는 거예요. It is certain that this phone call is for him.
저한테 질문한 거예요?
Is it that you asked me a question?