The term originated in computer games and it's meant to describe a game where its playing field is wide open for the player to do what they want. Around 2005 with the release of Necromancer Game's Wilderlands of High Fantasy Boxed Set, its authors—I am one of them—used it to describe to people what made the Wilderlands different from other settings. It was designed to make it easy for the referee to adjudicate his players roaming freely across the map.
Later still, the term got attached to a specific playstyle as mentioned by mxyzplk. However this is beyond what myself and other Wilderland authors intended. The problem is that people take the hard-core simulation of wandering the map too literally. This often results in frustration as many PC groups feel rudderless and the game feels without direction. In fact, if you read through various forums posts, such as on ENWorld, you see these campaigns fail more than succeed.
The trick to overcome this is "World in Motion." You work with the characters to give them a background they like in the setting. This provides a framework in which the players can make their initial choices. This background can incorporate what some consider railroad elements, like being members of a noble household, a guild, a temple, etc. But the key difference is that the players are free to leave or ignore those elements, as long as they are willing to suffer the consequences.
Along with this you develop a timeline revolving around NPCs and events. This timeline is created with the idea that this is what happens if the players didn't exist in the campaign. This timeline becomes your plan. It gets altered as a result of the consequences of the players' actions. At some point the campaign will become self-driving as the consequences of the consequences start propelling the players forward.
Again the Sandbox was meant to describe a type of setting, not a playstyle. But you can't control how these things go on the internet, so hence the confusion.
People often get confused on due to the prior use of Sandbox in campaign. The term "Sandbox" was used for RPGs prior to the development of the Wilderlands Boxed but it for other aspect of gaming than a type of campaign and setting. Some examples include:
Dragon #25, Tim Kask
He still clings to the shibboleth that wargamers are classic cases of arrested development, never having gotten out of the sandbox and toy soldiers syndrome of childhood.
Dragon #247, Page 123
Grubb has a phrase for working with existing games, settings, and characters: playing in other people's sandboxes."
Later in the issue
Having gone freelance three years ago, Grubb has explored new sandboxes. I worked on Mag Force 7's Wing Commander and Star Trek (original series) trading card games, ...
In this issue sandbox"sandbox" was used interchangeably with how most Roleplaying gamerroleplaying gamers use campaign.