T cell "patrols" come over and check. Through the MHC l molecules, they see different proteins than what should be there. Alarmed, the T cell orders the cell to destroy itself by apoptosis, the programmed death of a cell. The infection is over.
Now, let's go another way, pretending that the virus was not seen. Then, it makes copies of itself using the cell's resources until the cell bursts, releasing thousands of viruses (They sure are tiny...) into the body, where they will either die or make more viruses. This repeats until dendritic cells, killer T cells, and natural killer cells arrive to stop the infection.
"How do they stop the infection?", you may ask. It is simple- the dendritic cell goes to the lymph nodes, as explained in here, and finds the right T cell, then the activation process begins: some helper T cells go to the battlefield, encouraging and ordering warriors, and some go to activate killer T cells and B cells. When killer T cells get activated, they go to the main infection point and search for the antigen, and B cells and plasma cells produce antibodies.
This is why an infection might last a week; this process may last three to four days, and the ending battle may last three to four days.