When you have seen all the pokemon in the Pokedex.
It opens after beating champion, then going 2 prof rowan's lab and you will meet prof oak there also. He will leave to pal park and you will have access to entering there whenever you want
When you have put six pokemon in it by migrating. . Or finish the champion and get the national dex. .