You have defined your task as being Manually Scheduled with a Duration of 100 hours.
As you apply resource to this task, since it is manually scheduled, MS-Project will keep the duration at 100 hours as that is what you made it. It will calculate how much Work is done in that task by calculating the total based on the amount of resource you apply.
If you make the Work column visible you will see that MS-Project has calculated the work for this task as 150 hours. This is because you have used John at 100% of 100 hours and Mary at 50% of 100 hours, equals 150 hours. 150 hours work fits into a 100 hour duration using resources totalling 150% of the duration.
If you want MS-Project to vary the time depending on the resource applied then a) make it Auto-Scheduled b) Check the Effort Driven box for the task
Description The Effort Driven field indicates whether the scheduling for the task is effort driven scheduling. When a task is effort driven, Project keeps the total task work at its current value, regardless of how many resources are assigned to the task. When new resources are assigned, remaining work is distributed to them.
Best Uses Add the Effort Driven field to a task sheet when you want to set whether tasks are effort driven or resource driven directly on that sheet. If you want the same duration to be scheduled regardless of the number of resources assigned to the task, click No in the Effort Driven field. If you want the duration to be dependent on the availability and effort of the assigned resources, click Yes in this field.
Example You have a task to create a set of architectural drawings with a duration of four weeks, which is how long the task would take one drafter to complete. Because the task is effort driven, you assign four drafters to the task and Project will schedule the task to be completed in one week. In this case, you click Yes in the Effort Driven field.