I would probably look into using the "data.table" package.
The general approach I would use is to use order or rank to create your "category" column. The thing that's nice here is that you are not really limited by comparing two dates.
DT <- data.table(df)
DT[, category := order(date), by = id]
DT
# id date category
# 1: 101 2012-09-18 2
# 2: 101 2012-08-21 1
# 3: 102 2013-03-25 1
# 4: 102 2013-04-15 2
If you wanted text labels, you can use factor:
DT[, category := factor(category, labels = c("Early", "Late"))]
DT
# id date category
# 1: 101 2012-09-18 Late
# 2: 101 2012-08-21 Early
# 3: 102 2013-03-25 Early
# 4: 102 2013-04-15 Late
For convenience, this is the "df" that I started with:
df <- structure(list(id = c(101L, 101L, 102L, 102L),
date = structure(c(15601, 15573, 15789, 15810), class = "Date")),
.Names = c("id", "date"), row.names = c(NA, -4L), class = "data.frame")
id?