Temporary charisma buffs will make it possible to get a lot more settlers according to this [steam thread](https://steamcommunity.com/app/377160/discussions/0/496881136902383792/)
>Charisma boosting gear also increases the max, the calculation is 10+CHA stat(maximum of 11 with bobblehead)+CHA bosting gear/drugs=max pop, though there are some conflicting reports about the longevity of that solution

[This reddit thread](https://www.reddit.com/r/fo4/comments/3slqsv/psa_your_maximum_population_in_a_settlement_is_10/) also confirms going over 22 but reverting to normal when going back : 
>I had the same thing with vanilla. If you go back to the settlement it will revert to 10+CHA. The number keeps increasing if your out. Then it remembers it can only have so many and the institute comes for them (fast traveled back and syths were attacking so it is headcannon now)

The number is 10 + 1 per charisma point [as written here](http://www.tentonhammer.com/guides/fallout-4/fallout-4-settlement-building-and-management-guide-power-water-food-and-more):

>Successful settlements need four critical things: beds, food, water, and defense. In the same respect, power is required to meet these needs beyond the most basic sense, especially for defense. There is an easy and quick way to understand how much of each you need:

> - Beds: One per settler (max of 10 settlers plus 1 settler per Charisma point).
- Food: One food per settler.
- Water: One water per settler.
- Defense: One point per settler, although more is more helpful.
- Power: Add all of the power consumption things you need running, that’s the required power.

> As noted, you’ll probably have a max of 11 to 20 settlers, depending on your build.

So make sure you have enough water, food and defense with at least 1 charisma to get up to 11 and more.

So the max should be 21 as it is possible [to get a SPECIAL over 10](http://gaming.stackexchange.com/questions/242637/can-special-stats-be-increased-past-10), with charisma at 11, that would make possible to have 21 settlers with the same amount of beds, food, water and defense.