hi Mary,
I have not run your program, but I take it from you that your code is working for small input arrays.
According to the specs of that exercise, the sizes of the two arrays can be 10^5, so if you get such arrays, and r1, r1 , c1 and c2 are 1 and max (and knowing HackerRank a little, I'm sure they will give you these) that means that you are trying to calculate 10^10 gcd's, and that number is way too large to calculate them all. You can
test whether that is the problem, just add to your 'calGCDSubMatrix' method some print statements, for instance what r1, c1, r2 and c2 are, and the number of the calculations that must be performed ((r2 - r1 + 1) * (c2 - c1 + 1)), and print out, say, every 1000th of these calculations. That gives you an idea how fast it goes.
At least you can see if your code is still running, and how long that submatrix will be going to take.