How does the gravity affect of a black hole pull in light?
aren't photons massless?
In relativity, gravity curves spacetime, and particles (massless and non-massless) follow the shortest paths in that curved spacetime. Therefore, gravity effects photons.
Yes, as nicksauce points out, gravity does not pull things; gravity is simply a curve in spacetime. Photons follow this curve, just like massive particles do.
Separate names with a comma.