What the difference between functions and macros

Could you explain please in which cases I should prefer macros over functions