I2C device not detected

The level shifter is for the SDA and SCL signals.
SDA and SCL are connected to the MPU-6050 chip, which is a 3.3V chip.

When the GY-521 module is connected with VCC to 5V, the MPU-6050 runs at 3.3V, and the pullup resistors on the GY-521 are to 3.3V.
The Arduino running at 5V requires 0.7 * VCC for the I2C bus for a high level. That means 3.5V is required. The internal pullup resistors to 5V in the Arduino help a little to raise the voltage levels, but probably not enough.
Depending on the value of the pullup resistors on the module, the internal pullup resistors of the Arduino might even raise the voltage of SDA and SCL too much and damage the MPU-6050.

When you connect 3.3V to the VCC of the GY-521 module, that 3.3V has to go through a voltage regulator and the MPU-6050 will not run at 3.3V but at a little lower voltage. That makes it even harder for the Arduino to detect a high level on SDA and SCL.

In most cases it will work even when it is not okay according the datasheets. Run the i2c scanner and connect 5V to VCC of the module. If you are using a breadboard and it does not work, then bad contact of the breadboard are often the problem.