There is no way to set hard limits on resource usage per query or per user in PostgreSQL, however, there are a couple of things that may help limit some types of resource usage.
There are a couple of settings, temp_buffers and work_mem, that set some limits on some types of memory usage. From the manual:
temp_buffers (integer)
Sets the maximum number of temporary buffers used by each database
session. These are session-local buffers used only for access to
temporary tables. The default is eight megabytes (8MB). The setting
can be changed within individual sessions, but only before the first
use of temporary tables within the session; subsequent attempts to
change the value will have no effect on that session.
A session will allocate temporary buffers as needed up to the limit
given by temp_buffers. The cost of setting a large value in sessions
that do not actually need many temporary buffers is only a buffer
descriptor, or about 64 bytes, per increment in temp_buffers. However
if a buffer is actually used an additional 8192 bytes will be consumed
for it (or in general, BLCKSZ bytes).
work_mem (integer)
Specifies the amount of memory to be used by internal sort operations
and hash tables before writing to temporary disk files. The value
defaults to four megabytes (4MB). Note that for a complex query,
several sort or hash operations might be running in parallel; each
operation will be allowed to use as much memory as this value
specifies before it starts to write data into temporary files. Also,
several running sessions could be doing such operations concurrently.
Therefore, the total memory used could be many times the value of
work_mem; it is necessary to keep this fact in mind when choosing the
value. Sort operations are used for ORDER BY, DISTINCT, and merge
joins. Hash tables are used in hash joins, hash-based aggregation, and
hash-based processing of IN subqueries.
You can also limit the number of connections a user can make at once by altering that users role:
ALTER USER user_name WITH CONNECTION LIMIT 2;
That may help limit how many processes a user can run concurrently.