Subtitle files are generally external to the video, although some can be burned directly onto the graphic video display.
For external subtitles, take a look at Subtitle Edit-
Subtitle Edit is a free (open source) editor for video subtitles - a
subtitle editor :)
With SE you can easily adjust a subtitle if it is out of sync with the
video in several different ways. You can also use SE for making new
subtitles from scratch (do use the time-line/waveform/spectrogram) or
Subtitle Edit can read, write, and convert between more than 200 subtitle formats,
There are so many features that I won't list them here for running out of pixels (won't someone please think of the pixels??!!). Check out the site and be impressed.