Functions are blocks of code that perform specific tasks and can be called whenever needed. They are defined using the def keyword followed by a name and parameters, and can contain lines of code and a return expression. There are two types of functions: built-in functions that are pre-defined in Python like len() and print(), and user-defined functions that are created by programmers using def and can be called anywhere in the code.