Joining tables on DB server vs App-Backend server
JOINing is an important, standard, operation in SQL.  It is possible, but not that standard in app languages.  Do it in SQL.

Ditto for other operations, such as aggregation (eg SUM with GROUP BY).

Ditto for sorting (ORDER BY) and limiting (LIMIT).

Also, consider the amount of data that might need to be transferred.  In most example like the above, less data need be shoveled to the client.  This is another argument for doing the work in SQL.

Another argument...  SQL can handle a 1-row table or a billion-row table.  It does not care.  It will probably use totally different code for each (RAM-based code versus caching versus disk-based).  Do you really want to compete with that level of sophistication?

SQL loves doing "set-based" operations; client code loves tedious 'for'-loops.  Why write a for-loop when a single SQL statement will do the 'for' and the stuff inside it?

Use SQL for what it good at.

In rare cases, some tasks are better done in client code.  Your Question comes nowhere near such.