How to use the COUNT function to count up to the current row for each row?
This will do it

select UserName, 
       EventDate, 
       row_number over (partition by UserName order by EventDate asc) as EventNumber 
  from AllEvents