User defined functions can be used anywhere in the queries i.e. within where/having/select section where as stored procedures can’t.
Note: Stored procedures can be used with insert statements. UDFs can also be used in join operations and UDFs can be used to return tables which can be joined with other tables.