The left-sided winger or full-back has made two first-team appearances for the Hammers this term as a substitute in the Capital One Cup games against Crewe and Wigan.
The 18-year-old has also been a regular starter for the Development Squad in recent seasons.
Fanimo told the club's official website: "I think it's a good achievement to get another contract at the club.
"I enjoy playing here and I hope it continues. I was seven when I joined the club and I've come a long way. It's been a good journey and I've had some ups and downs but I think I'm doing pretty well for myself at the moment.
"It was definitely a good experience for me to come on and make my debut. It was a surprise to me and I'm glad that I did it.
"I want to get my Premier League debut under my belt because that would be another good experience for me. I just have to keep working hard and hopefully the manager notices me."