Here is one method that numbers the episodes in alphabetical order. It uses the fact that factors are stored as integers.
DF <- data.frame(personID=c("wx","wx","aaa","aaa","aaa","oiy"),
+ time = as.Date("2020-06-15", "2020-06-15", "2019-07-01",
+ "2021-08-20", "2021-08-20", "2020-12-19"))
DF
personID time
1 wx 2021-08-16
2 wx 2021-08-16
3 aaa 2021-08-16
4 aaa 2021-08-16
5 aaa 2021-08-16
6 oiy 2021-08-16
library(tidyr)
DF <- DF %>% unite(col =Episode, personID:time, remove = FALSE)
DF
Episode personID time
1 wx_2021-08-16 wx 2021-08-16
2 wx_2021-08-16 wx 2021-08-16
3 aaa_2021-08-16 aaa 2021-08-16
4 aaa_2021-08-16 aaa 2021-08-16
5 aaa_2021-08-16 aaa 2021-08-16
6 oiy_2021-08-16 oiy 2021-08-16
DF <- DF %>% mutate(Episode = factor(Episode),
Episode = as.numeric(Episode))
DF
Episode personID time
1 3 wx 2021-08-16
2 3 wx 2021-08-16
3 1 aaa 2021-08-16
4 1 aaa 2021-08-16
5 1 aaa 2021-08-16
6 2 oiy 2021-08-16