The setting that will do this for you is Effort Driven. This tells Project that you want to keep the effort (hours) consistent when you add or remove resources. To set this for new tasks, go to Options / Schedule tab, and set the New Tasks Are Effort Driven checkbox to selected. If you have an existing project, you will also need to reset this for existing tasks. This can best be done either by using the Effort Driven column or the Task Information dialog.
The other setting that goes hand in hand with Effort Driven is Default Task Type. If you want effort to be maintained when you increase or decrease duration then set the task type (Type) to Fixed Work. If you want to increase or decrease work to match duration then set it to Fixed Units. Default Task Type is just above the Effort Driven setting.