E=mc^{2} just tells you how to relate mass and energy for a stationary object (one that isn't moving) at a single point in space-time. It's valid for any single point in space-time that you want to choose, as long as the object isn't moving, so that you can't tell the exact position and time just by looking at the equation.

By the way, the full equation is E^{2}=m^{2}c^{4}+p^{2}c^{2},

where p is *momentum*, which tells you about how the object is moving in space. This is usually the one you want to use, since it's valid no matter how fast you or the object is moving. If the object isn't moving, p=0 and this equation becomes E=mc^{2}.

Edit: to fix a sign error.