IMPORTANT UPDATE
Recently Apple released updates for devices running iOS 6 and 7 that patched a serious security bug. It is recommended for users to update as soon as possible. This bug affects all devices running iOS 6.0 to 7.0.5 (check your current version under Settings > General > About > Version). If you are already running iOS 6.1.6 or 7.0.6, then your device is fine, and you do not need to do anything.
The bug made any secure content vulnerable to an attack. This meant that anyone with the appropriate software connected to the same Wi-Fi network as an affected device could intercept and read all wireless communications, ranging from login passwords to message content sent between apps such as Facebook or Snapchat. This makes any public Wi-Fi network very unsafe.
Non-Jailbroken Users
To update, connect the device to iTunes and under the device summary tab, select "Update".
Here are the latest versions for each device:
iPod touch 4th generation - 6.1.6
iPhone 3GS - 6.1.6
iPod touch 5th generation - 7.0.6
iPad 2, 3, 4, Air, mini, mini with Retina display - 7.0.6
iPhone 4, 4S, 5, 5S, 5C - 7.0.6
If your device is not on this list, it means that it does not support the latest iOS versions, however it is running an older iOS version that is not affected by this bug, so you won't have to do anything.
Jailbreak Users
You can install a Cydia package that performs the same fix without having to update and lose your jailbreak. Just open Cydia, refresh the package list, then install SSLPatch.
UPDATE
There is speculation that this bug was the work of NSA sabotaging Apple software. However the evidence is purely circumstantial.