Find the gif that you want online, download it like you would download any image.
Then you just change your profile as you normally would.
Click on the Profile tab > Account Settings > Update Profile > Choose File > and Pick the gif you saved.
(Copied from Elliot)
Some gifs don't work, so just try a different gif if it doesn't (つ˘◡˘)づ♥