The TV certainly doesn't need to be on. However, some TVs (if hooked up by HDMI) can turn off source devices (like a cable box) when you turn the TV off. (My TV turns off my A/V receiver when I turn it off; my cable box is not hooked up directly to my TV but rather through my receiver.)
The cable box must be on if you want to view its output. If you have cable connected right to your Slingbox's cable input, you can view any analog and unencrypted digital cable channels via the Slingbox HD's built-in tuner without using a cable box, but you probably won't get as many channels and you won't be able to take advantage of any DVR feature on your cable box.