Sandbox mode is a place where you build your own machines/contraptions, and you get to use any piece you want. A Sandbox is unlocked by completing specific levels in Story Mode, with the exception of the Field of Dreams, which is purchasable.
It is possible to "earn" extra parts by completing various levels. It has been noted that if you acess any Sandbox, not just the specific one earned in, the extra part will be added to that sandbox level instead.
You do not have a goal, but you have to get 20 stars (40 stars in the Field Of Dreams) in each sandbox level. Once you get all the stars in the sandbox levels, (if you feel necessary), you can feel free to build what you want. There are sandbox levels for Ground Hog Day, Rise and swine, When Pigs Fly, and Flight in the Night.