There are a lot of solutions. In your code there is only one error. You must remove i from AppendTo[]:
In[6]:= x = {1, 2, 3, 4, 5};
y = {1, 2, 3, 4, 5};
result = {}
For[i = 1, i <= Length[x], i++,
For[j = 1, j <= Length[y], j++, AppendTo[result, {x[[i]], y[[j]]}]]]
Out[8]= {}
In[10]:= result
Out[10]= {{1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {2, 1}, {2, 2}, {2,
3}, {2, 4}, {2, 5}, {3, 1}, {3, 2}, {3, 3}, {3, 4}, {3, 5}, {4,
1}, {4, 2}, {4, 3}, {4, 4}, {4, 5}, {5, 1}, {5, 2}, {5, 3}, {5,
4}, {5, 5}}
But you may obtain the same result in other ways, e.g.:
In[13]:= result =
Table[{x[[i]], y[[j]]}, {i, Length[x]}, {j, Length[y]}]
Out[13]= {{{1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}}, {{2, 1}, {2,
2}, {2, 3}, {2, 4}, {2, 5}}, {{3, 1}, {3, 2}, {3, 3}, {3, 4}, {3,
5}}, {{4, 1}, {4, 2}, {4, 3}, {4, 4}, {4, 5}}, {{5, 1}, {5, 2}, {5,
3}, {5, 4}, {5, 5}}}