Is the gravity of light equal to the gravity of mass under $E=mc^2$? Under $E=mc^2$, 1kg of matter has $9\times 10^{10}$ joules of energy.  So, if I had just the light shining from $9\times 10^8$ 100 Watt light bulbs, would that light have the same amount of gravity as the 1kg of matter?
 A: No, a photon with energy $E$ behaves differently with respect to gravity than a slow-moving object of mass $m=E/c^2$ does.
In fact, that difference was behind one of the first tests of general relativity. General relativity is very nearly consistent with Newtonian gravity when it comes to slow moving objects in our solar system. However, if you use Newtonian gravity, and treat a photon passing by the sun as being an object of mass $E/c^2$, the amount by which the photon should be deflected is off by a factor of $2$ from what general relativity predicts. During the solar eclipse of 1919, Arthur Eddington made measurements of the deflection of starlight which passed close to the sun. His results were consistent with general relativity, and inconsistent with what was predicted with the combination of Newtonian gravity and $E=mc^2$.
Light also behaves differently from a slow-moving mass as far as being a source of gravity. General relativity describes gravity as involving the curvature of spacetime. The source of that curvature is the stress–energy tensor, which has 16 components, instead of being just one number (mass) that's the source of gravity according to Newtonian gravity. A photon's energy and momentum contribute differently to the stress-energy tensor than does an object with a non-zero rest mass.
However, if the light in question is bouncing around inside of a perfect mirrored box, and the lengths and time scales of interest are large compared to the size of the box and how long it takes light to bounce from one side of the box to the other, then yes, it would work to treat the light more simply as a stationary gravitational source with a mass of $E/c^2$.
