Classification is used when your target is categorical, while regression is used when your target variable is continuous. Both classification and regression belong to the category of supervised machine learning algorithms.
Examples of classification problems include:
1) Predicting yes or no
2) Estimating gender
3) Breed of an animal
4) Type of color
Examples of regression problems include:
1) Estimating sales and price of a product
2) Predicting the score of a team
3) Predicting the amount of rainfall