Pacifiers are good for babies and can help prevent SIDS but you should ideally take the pacifier away from the baby after they turn 1 year of age before they get too addicted to the pacifier.
A child really doesn't need to use a pacifier past 1 year of age but it's perfectly okay for the child to use a pacifier up until 4 years of age if it helps to soothe them and comfort them.
A child should no longer be using a pacifier once they turn 4 years old though so you really need to force the issue once the child is 4 years old.
I've seen a few older kids around 8 and even 10 years old in public still using a pacifier and that is too old and the pacifiers should've been taken away from the child before they turned 8 to 10 years old.