In ASP.NET MVC - these are almost same but purpose is different.
TempData[] can persist for two request whereas ViewData[] only for one request.

Normaly TempData[] is used when we are passing some info from one request to other. like in case of exception we wanted to get exception instance on error page. so in this case we can keep exception instance in TempData[].

Please find mire on reference links.