If you’re on iOS:
Open Control Center → tap the record button “●” → to stop, tap the button again or tap the red bar at the top. The video will be saved in Photos.
If you’re on Android:
Swipe down from the top of the screen to open the Quick Settings panel → tap Screen Recorder → to stop, open Quick Settings again and tap Stop. The video will be saved in your Gallery.