Keys are one of four items that you collect as you journey through LittleBigPlanet. Along with Prize Bubbles, Collectabells, and Score Bubbles, Keys help motivate you to make progress and compare your efforts to other players.
On average, there are around 3 keys per Creator Curator area, thus meaning around one key per level. Some levels have two keys, such as The Wedding Reception. Some can also be well-hidden, more so than some prize-bubbles, adding to the replayability of certain levels. Collecting a Key increases your score by 50 points and grants you access to another sub-level on your world. These levels are mini-game challenges; Score and Survival Challenges, where you either race to the end as quickly as possible, or collect as many points as possible without dying. One example is the first key in The Gardens, which unlocks Tie Skipping.
You can add keys to your own or friends levels. For each level you publish, you get a key for it in your Tools Bag. You can then add this key to any of your other levels so other players can unlock it. It's good for making chains of levels in a series, such as level "sequels".