Regression and classification are both used in supervised learning models. There is some input data \(\overrightarrow{x}\) and some output \(y.\) If the output values \(y\) are continuous, then it is appropriate to use a regression model to predict outcomes. If the output values \(y\) are discrete, then it is appropriate to use a classification model to predict outcomes.
Housing prices are one example of a continuous output. Given a set of attributes about the house, one would make a prediction which is a non-negative number rounded to two decimal places. One could use a regression algorithm such as linear regression to approximate housing prices.
Classifying email as ham or spam is a discrete output. A classification algorithm such as Naive Bayes could be used to predict whether an email is spam.