Viruses (virii) are malicious code that is attached to otherwise seemingly legitimate files. Virus code is activated when the infected file is opened by an executable. Once activated, virus code can perform a variety of malicious functions.
Note that a virus does not run by itself, it relies on a target vulnerable program to activate the malicious code.
The extent of damage of a virus can range from end user account hacking to system-wide compromise.