How do I download videos from YouTube with subtitles / captions?
I'd tried by using youtube-dl, with --write-srt --str-lang flags but I always get:
WARNING: video has no closed captions.
Make sure the video you're trying to download has actual subtitles uploaded from the owner.
You can then use, for example:
youtube-dl --write-srt --sub-lang en 'http://www.youtube.com/watch?v=RHy9_RQbrnQ'
There is also an option to download the automatically generated subtitle files, using --write-auto-sub.
See the youtube-dl documentation.
If you want a free, easy-to-use program with a simple GUI, there's Google 2 SRT.
It detects all the available languages and converts to SRT, SSA or SUB.

You did not specify what kind of subtitles you want to download.
If you want regular youtube subtitles in .SRT format (the most widely supported by players) then you would use (assuming you need English subs):
youtube-dl --convert-subs srt --write-sub -sub-lang en <YOUTUBE_VIDEO_ID>
If you want auto-generated youtube subtitles then you need to use instead:
youtube-dl --convert-subs srt --write-auto-sub --sub-lang en <YOUTUBE_VIDEO_ID>
# ^^^^^^^^^^^^^^^^
To list available subtitle languages use:
youtube-dl --list-subs <YOUTUBE_VIDEO_ID>
Once you have identified the languages you want you can request multiple subs with e.g.:
youtube-dl --convert-subs srt --write-sub --sub-lang="en,de,es,zh,zh-CN,zh-TW,zh-HK,zh-Hans,zh-Hant" <YOUTUBE_VIDEO_ID>"