Q:

When exactly to use logistic instead of linear regression? 

In andrews logistic regression example of cancer, I can draw a horizontal line y=.5, (which obviously passes through y=.5 ), ten if any point is above this line y=.5 => +ve , else -ve.  So then why do I need a logistic regression.  Im just trying to understand the best case explanation to use logistic regression ? 

As you can see in the image included , a horizontal line clearly classifies the two classes , why then go for logistic ? 

A:

In short, when you need classification, i.e. to predict one of predefined (nominal) classes, use logistic regression; when you need regression, i.e. to predict quantitative value, use linear regression. 
Also linear regression assumes the linear dependency between inputs (features) and outcomes, while logistic regression assumes the outcomes to be distributed as a binomial.  Response of logistic regression can be interpreted as a classifier confidence. 
Take a look at answers to similar questions at stats.stackexchange or differencebetween.