Depends on the model of iMac and what connectors your TV has. Assuming modern versions of both, you are probably going to need an Apple Mini-DVI adapter, which is what recent iMacs have as secondary video out. The adapters will take that to DVI, VGA or HDMI, or even component video depending on what your needs are with your TV.
When I researched this for my TV, I leaned that the best way is if your TV has a "PC Input", which means high-res VGA. Such an input will get automatically recognized by your mac as a 2nd monitor, auto-adjust the resolution on your iMac, and make a pixel-accurate representation on your TV. I heard horror stories of aspect ratios, resolution settings, overscan and other general hassles that are more prone to pop up with the other connectors.
They are short, and you will need to get another cable to run the distance. They are intended to be just the adapters to get you from the Mac's mini-DVI to a standard connector, not the cables.