One common class of trojans are fake login programs - collecting accounts and passwords by prompting for this info just like a normal login program does. Another is a disk defragger that erases files rather than reorganizing them. A Trojan Horse differs from a virus in that the former does not attempt to reproduce itself. A Worm is just a self-propagating virus. The Internet Worm from November '88 is a famous example.
Viruses come in many shapes and sizes.
Recently, the world was exposed to Melissa, a virus that was used as an attachment to e-mail messages. It wreaked havoc worldwide because every time the attached document was opened, it sent 50 additional e-mail messages to addresses of the user. It was discovered later that the author of the virus had created it for an exotic dancer in Florida. Here is a brief overview on how some virus work. Thus, they are invoked each time the infected program is run.