You can get keys in your game by earning more stars, sending requests to friends, purchasing them with jewels, or by waiting for a free key.
The time for a free key gets longer as you get to higher levels.
For example, on level 100 you would have to wait 9 hours per key to make a total of 27 hours, but on level 300 you would have to wait 12 hours per key to make a total of 36 hours.
If you do not wish to wait for a free key:
You can earn more stars on the final stage that you are on, send requests to friends, or open the lock using jewels.
Stars can be earned by beating levels.