You mean a user defined function in TSQL? That's just another way of writing a query (assuming we're not talking table valued user defined functions). There isn't, per se, a difference between calling a function and calling a query.
The way to tell if there's a difference is to look at the execution plans, the execution time, and the scans and reads. Then you can determine which is the better approach.