iMovie doesn't have an easy way to add subtitles, so you may want to explore other options (like using Premier Pro to generate captions once your project is finished in iMovie). Here are some directions for various methods.
NOTE: If you want to create captions for subtitles, Premiere Pro can auto-generate a transcript that can be turned into captions. These can be hard-coded into your video, or you can download the .srt file for use on platforms like YouTube.