Assuming that you want to do this for all users, the easiest way is to use variables:
select t.*,
if(u_id = @u_id, timediff(`timestamp`, @timestamp), NULL) as diff,
@timestamp := `timestamp`, @u_id := u_id
from table t cross join
(select @timestamp := 0, @u_id := 0) var
order by u_id, timestamp;
It is important that you explicitly order the records to be sure that the processing occurs in sequential order.