To caption a photo or video, simply swipe up on it, tap "Add a Caption," and write your caption or keyword. When you're done, it'll save to iCloud Photos. After that, just type the caption or keyword into the iPhone's Search window.
Add captions to photos and videos