Step 1: Go to Settings > General > Accessibility > Guided Access
Step 2: Select Guided Access and toggle the switch to the On position
Step 3: Set a four-digit passcode
Once you have enable Guided Access, open the app you want to run and triple-click the home button. This will bring up options. You just need to touch Start and the feature is on. The student can use the app as normal but if he/she tries to exit the app it won't work. A box will pop up that says Triple-click the home button to exit. Even if the student can read this he/she needs to know the passcode.
To exit the feature, triple-click the home button, enter the passcode and touch end. To disable Guided Access on your device, just toggle the switch to Off in the Accessibility section of Settings.