Optical audio, specifically using a TOSLINK connection, typically supports up to 5.1 channels of audio.
While HDMI is capable of carrying more advanced audio formats like Dolby Digital Plus, TrueHD, and DTS HD, optical audio is generally limited to compressed surround sound formats. This means you can typically get a standard 5.1 surround sound experience (left, center, right, left surround, right surround, and a subwoofer channel) through an optical connection.
Keep in mind that the actual number of channels you get depends on the source material and the capabilities of your audio equipment. While some Blu-ray discs offer enhanced audio formats, many television broadcasts are already in surround sound.