Touch and hold on a single icon until they all start "wiggling." Then, drag the icon back to where it needs to be. To drag it to another page, drag the icon to the edge of the screen (left or right, depending on which way you want it to go) and hold there until the page switches.
After you're done, press the home button to get those icons to stop wiggling.