Don’t mean to flog a dead horse (and I admittedly skipped the last couple of replies because everyone has been giving such detailed answers), but I figured I’d share my own experience: my opinion is that it’s best to watch anime (or something else you like) with subtitles first, and to try to drop them or switch to Japanese subtitles later.
I watched Konosuba for a long time (yes, I repeated the series several times) with English subtitles. I sometimes started watching before bed and dozed off in the middle of an episode. The more Japanese I knew, the more words I caught, but I honestly don’t think I learnt many new words by watching the show because I just didn’t know enough Japanese to pick out the more complicated expressions. I definitely learnt a few things, but I wouldn’t say it was particularly productive. However, what that did do for me (because I made a conscious effort to avoid relying on the subtitles and to listen for words I already knew) was that it helped me improve my listening comprehension. When I started the Tobira textbook, I had a lot of trouble recognising words on the page at the same speed as the recording, but my ears would continue to tell me what was going on even though my eyes were glazing over.
At the moment, I’m watching The Rising of the Shield Hero without subtitles with an Anicobin reaction blog open on the side. (The blog is basically Japanese subtitles, because the blog transcribes what’s being said for each screenshot.) It’s definitely true that I’m picking up more than when I watched it with subtitles: I can fully engage with what’s being said and how it’s being phrased, and any emotional experiences that I once had with the show are now magnified because all my attention is on the events that are unfolding on screen. I’m also starting to be able to extrapolate what’s being said even when I don’t know what words are being used, because I can make guesses based on the sounds I hear and kanji/words that I already know. However, if I really want to understand 100% (I think my comprehension is probably at 70-80% of the words used), I still have to stop the video quite frequently to consult the transcription on the blog. Maybe I’m just no good at picking things up with my ears, but sometimes, the syllables just come out way too quickly for me to catch them when I don’t know the words being used. For that matter, sometimes, even after consulting the transcription, I’m not able to process the words at the speed they’re being said until after I’ve listened to the relevant segment 4-5 times. If you’re very good at picking out Japanese syllables even when people speak fast, then it might be possible to learn directly from anime. Otherwise though, you’re probably going to need subtitles or transcriptions to help you learn new words, and you’re definitely going to need grammatical knowledge to help you along. At this point, I rarely run into grammatical structures that are genuinely new when watching anime, but not knowing the verbs involved means it’s as good as Greek to me (because I really am not at all fluent in Greek).
Side note: I'd like to add that I found this to be true while learning French as well (I am now fluent in French)
I couldn’t pick up many new words by listening until I was really quite advanced – let’s say fluent enough to read short news articles without too much trouble –, and even then, I could only do it because French has a system of prefixes and root words that are extensively used. Throw me a word in some sort of French slang (argot, verlan and so on) and I will probably be stuck as to its meaning even if I can guess how to write it, unless context makes things obvious. Verlan is OK because it’s made literally by inverting syllables, so it’s fairly obvious, but stuff that doesn’t follow the system of word formation I’m used to? I’ll need to ask a friend or check the dictionary. I’m getting better at it because now that I’m a student in France, my classmates use such words a lot, but guessing wouldn’t be possible without a foundation in French slang.
To sum up: unless your Japanese listening skills are already particularly advanced and you’re able to pick syllables out very easily, you’re probably better off with English subtitles at first. It’s more enjoyable that way, and some words will start to stick because you always hear them when the same English words are on the screen, especially characters’ speech tics. When you’re more advanced and you can feel yourself recognising most of the basic structures without the help of the subtitles, then you might want to consider watching without subtitles, but probably with a transcription nearby so it’s easier to look things up. In the meantime, keep studying grammar and easier Japanese texts so you can build up a sense of how Japanese sentences work, possibly with a textbook.
PS:
I think this might be doable for Japanese if you start by watching shows for children. Maybe family television or Doraemon. Those should have easier sentences that you’ll be able to decipher even with minimal grammatical knowledge. Otherwise though… what I said about the dialogue being too rapid to follow making it hard to make out the words that are being said.