The easy, safe and cheap option is train station lockers, which can be found at all major train stations in Tokyo (and Japan). Japanese lockers are usually narrow but deep, so while hard plastic suitcases will not fit into them, backpacks are generally not a problem. Some larger stations (eg. Tokyo stn) also have manned left luggage counters (手荷物預かり所 nimotsu-azukari-dokoro), which can handle any size of bag and only cost a bit more than lockers. On station maps, these are usually shown with a "bag-and-key" icon, while lockers are "bag-in-box-with-key".
Which one to recommend, though, is going to depend on what you were going to do during your day in Tokyo and how you're planning to get around.
- If you're planning on exploring around Shibuya or Shinjuku, I'd take the Keikyu railway from Haneda and leave the bag at Shinagawa. Shibuya and Shinjuku are a few stops away on the Yamanote line, and you can continue to Narita directly on the JR Narita Express (N'EX).
- Alternatively, you can transfer from Shinagawa to Shibuya/Shinjuku with your bag, leave it at either station, and then take the N'EX.
- If you're planning on exploring around Ueno and Asakusa, I'd take the monorail to Hamamatsucho, connect to Yamanote, and leave the bag at Ueno. Ueno Park is walking distance, Asakusa is a few stops away on the Ginza Line, and you can continue to Narita directly on the Keisei Skyliner (premium) or Sky Access Limited Express (cheaper, slower).
- You can also take the Keikyu line via Shinagawa directly to Asakusa, but this takes approximately forever and may require a transfer along the way.
I probably would not recommend Tokyo station: it's huge, remarkably confusing, not terribly close to anything interesting (although naturally it's well connected to the entire city), and not super easy to get to from Haneda. That said, there are very cheap buses from Tokyo stn to Narita, so if you're really pinching pennies it might be worth hassle.
One tip: when you do leave your bag, pay careful attention to where the locker is and how you got there, these are all massive stations and (voice of experience) it's no fun running around trying to figure out where the hell you left it...