You need to use a quantifier {2,}and use two \1in the replacement:
s<-'hhaaappppyyyyyyy mmoooooorning friendsssssssssssssss, good goood day'
gsub('([[:alpha:]])\\1{2,}', '\\1\\1', s)
See a demonstration of the R .
The pattern ([[:alpha:]])\\1{2,}matches and captures the letter in group 1, and then 2 or more repetitions of the same char are repeated. Two \1in the replacement pattern replace all matches with 2 occurrences of char. You can use two placeholders \1because each match has at least 3 identical characters.