y = x is simply a straight line equation telling you that if your x axis reads 1, your y axis will read 1 too, and if reads 232.1, your y coordinate will be the same... and so on.
Th gradient, is the the number next to the'x' in this case, there is no number, so we assume its +1.( instead if writing y = 1x+0)
If it was Y= -x, our gradient would be -1.
Hope this helps!