The first notable thing that differentiates UDF (that is User Defined Function) and the stored procedure is that the user-defined function must return a value, while the factor for the stored procedure to return value depends on whether there is a value at all to return.
Another difference is that the stored procedure allows you to use, update, and manipulate both select statements and the DML statements, while the user-defined function can only allow you to read the select statements, but deny you from accessing the DML statements. In a stored procedure, you can be able to input and also have the output of parameters, while the user-defined function only allows for the input of parameters, but will not support the output of the same parameters.
The stored procedure allows transactions to happen within functions, but the UDF gives no allowance for this. In addition, store procedure allows the user of temporary table and table variables, while the UDF does not allow for the usage of table variables and temporary table.