When slaughtered in large farming operations the chickens get electronically stunned before they get slaughtered.
The electric stunning of the chicken stops the chicken from feeling any pain when it is actually slaughtered.
If you slaughter chickens at home or on your farm without stunning the chicken then yes the chicken will feel pain if you just cut it's head off.
To remove the feathers from the chicken they are scalded in boiling water.
Most chickens that are farmed commercially and slaughtered and sent to processing plants etc are raised to gain weight really fast and those chickens are usually slaughtered at between 5 to 7 weeks of age.
However at home when you raise chickens the best age to kill a chicken or slaughter a chicken for it's meat is before 8 months of age.
Preferably you should be able to slaughter or kill your chicken for meat after around 3 to 6 months of age.
After 8 months of age the chicken can still be slaughtered for meat but the chicken meat from a chicken over 8 months of age is tougher and may not be as good.
So if you want the best meat from your chickens slaughter them before 8 months of age.