It takes about four years to become a professional boxer. The average professional boxer is 20 years old at their debut, and most amateur boxers begin taking fights at sixteen years old. There is nuance to this, and the first fight for someone does not mean the first time they have ever trained, but this is a good benchmark.
On average, an amateur boxer will compete in 118 fights before debuting as a professional boxer. That is generally 118 fights in four years, assuming the boxer began fighting at age sixteen. So while four years may seem super short, it is an extremely intensive training time.
Boxers begin training before their first fights, and once they feel they are at a level to compete, they begin fighting in fights. The preparation time varies greatly between boxers; it can depend on their natural talent, immediate financial needs, and even their country.