Animated lock screens are a cute gimmick. Your phone comes loaded with a few default options. But if you want to make your own on Android or iOS, you'll need a third-party app.
On iOS, use intoLive to turn videos, animated GIFs, or sets of still photos into a "live photo." (You can also use any "live photo" you shot with your phone. But because live photos take up space and are otherwise pretty useless, you probably turned them off long ago.)
Because this is a minor market, all these apps are a bit wonky and weird. But they let you pull off some neat tricks:
Put a GIF on It
A lock screen is the perfect place for a GIF. This works best with high-resolution GIFs, especially vertical ones, rare as those are. Avoid GIFs with captions. Here's one I made using this GIF of the Grinch grinning:
Make Yourself a Ghost
In his custom animated lock screen, Reddit user netpastor materialises from the dark like a ghost. It's nothing fancy, just a video shot in a dark room. Netpastor says he just rotated a lamp toward him from offscreen.
Hide a Secret Photo
On iOS, you can use intoLive to stitch two or more still images into one "animation." This is like the world's worst slideshow, but it has at least one practical use. You can hide some information, like a screenshot of your travel itinerary, behind a more typical lock screen. Then it's still easy to access, but not too easy.
But mostly this is just a cute gimmick to play around with, helping you spend a few more seconds ignoring your texts.