Answer:
According to this hypothesis, viruses evolved early in Earth's history from fundamental replicative molecules that formed in the “primordial soup” as the planet began cooling. These molecules also led to the evolution of cellular organisms—the viral hosts—either in parallel or at a later stage of evolution.
That would have been 3 or so billion years ago, early in earths history.