One solution is to write a self-join on matching user and one timestamp less than the other, then in an outer query find the min(diff) and max(diff):
select t.user, min(diff), max(diff)
from (
select t.user, unix_timestamp(min(tnext.t))-unix_timestamp(t.t) as diff
from t
join t as tnext on t.user=tnext.user and t.t < tnext.t
group by t.user, t.t
) as t
group by user;
+------+-----------+-----------+
| user | min(diff) | max(diff) |
+------+-----------+-----------+
| 1 | 2 | 4 |
| 2 | 1 | 17 |
+------+-----------+-----------+
Thanks to Scott Noyes for noticing that the inner query must specify min(tnext.t).