The infection may spread if the infected Pokémon is in the main party after a battle. An uninfected Pokémon must be next to a Pokémon infected with Pokérus in the main party for the virus to spread. If Pokémon that have already been infected and cured from Pokérus are in the main party and are on either side of a Pokémon currently with the disease, Pokérus will not spread after any amount of battles. Pokémon that are put into the PC will keep the status indefinitely.
Source: Experience and Bulbapedia for the above