I have flip flopped on this issue in the past, but think I firm in my beliefs on it now. Personally I think that spanking is acceptable until the kid is old enough to reason for themselves that what they are doing is wrong. Obviously since this has to do with maturity and reasoning skills the exact age the spankings would stop changes. Before the reasoning age kids really don't have enough mental ability to get how what they are doing effects others enough for them to stop doing it.
After this age I find "mental" punishment to be much more effective than physical. For instance with my step-son instead of any spanking when he does something wrong, we make him write notes/letters about how what he did affects others negatively and how it have others change their thoughts on him (like when he lies we can't trust him etc). These punishments seem to have a much longer lasting effect and actually cause him to reason why hes doing whats wrong instead of just fearing a quick spanking whose pain will go away shortly after.
After this age I find "mental" punishment to be much more effective than physical. For instance with my step-son instead of any spanking when he does something wrong, we make him write notes/letters about how what he did affects others negatively and how it have others change their thoughts on him (like when he lies we can't trust him etc). These punishments seem to have a much longer lasting effect and actually cause him to reason why hes doing whats wrong instead of just fearing a quick spanking whose pain will go away shortly after.