Chapter 4 of the following documentation covers basic installation of JBoss and configuration for connecting to a database. Skip any application specific areas - http://www.amitysolutions.com.au/downloads/response_tester.pdf
Installing, configuring and managing the PostgreSQL database is beyond the scope of these particular forums to cover. Check with the PostgreSQL group - http://www.postgresql.org
For more on programming for JBoss, look at the excellent tutorial by Vashistvishal in the Beginner's Corner forum.