Slimani, who had earlier hit the post, met Marc Albrighton's cross with an emphatic header past keeper Darren Randolph after 20 minutes.
Leicester's fifth victory in 19 league matches lifted them to 15th with 20 points and ended a run of three wins for West Ham, who came closest when Michail Antonio's shot hit the bar.
The victory rewarded Leicester for their fine opening half hour after which West Ham took control and dominated possession but failed to score despite twice as many shots as their opponents.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
(Reporting by Rex Gowar, editing by Ed Osmond)
