Here's one method using the dplyr and stringr packages.
library(dplyr, warn.conflicts = FALSE)
library(stringr)
data <- tibble(reviews = c("the dog is on the mat",
"the cat is on top of the wall"))
data <- mutate(data, word_count = lengths(str_split(reviews, boundary("word"))))
print(data)
#> # A tibble: 2 x 2
#> reviews word_count
#> <chr> <int>
#> 1 the dog is on the mat 6
#> 2 the cat is on top of the wall 8
Created on 2020-05-07 by the reprex package (v0.3.0)