Query resource quota for PostgreSQL accounts
There is no support for resource quotas in PostgreSQL.
Your best bet is statement_timeout:
ALTER ROLE baduser SET statement_timeout = '10s';

You cannot limit the number of rows returned, but perhaps statement_timeout is good enough.