After Metatron expelled all the angels and locked the Gates of Heaven, he created a piece of spell work that allowed him to come and go from Heaven to Earth. The spell simply requires a specific sigil to be drawn. Once done, it will create a doorway into Heaven. It can also be opened from the Heaven side by simply opening a door marked 42.
The portal is currently located in a playground, prior to Metatron's reign coming to end he was known to move location of the entrance around. It is always guarded by one or two angels, who draw the Metatron's Cube sigil in a sandbox. As Metatron's spell has not be reversed, even after his capture, this is the only method for which angels can access Heaven from Earth.
Humans are unable to pass through this gate and survive. Castiel planned to have Kelly Kline walk through the gate, killing her and her Nephilim child, whose souls would ascend to Heaven, while every cell of their beings will return to the universe.
Metatron's Cube in Lore
Metaron's Cube is a a geometric figure composed of 13 equal circles with lines from the center of each circle extending out to the centers of the other 12 circles. It is an example of sacred geometry.