Each chapter tells a story and contains a themed set of levels with increasing difficulty. Complete levels with varying level objectives to earn as many stars as possible. All chapters are unlocked immediately; you can play them at your convenience. Collecting enough Stars will unlock the sandbox level for such a chapter.
You can switch between Chapters and Sandbox levels by tapping the Stars/Sandbox button near the screen's bottom middle side.