Did the phone previously work on this same router? Usually problems are due to the type of router, router settings or OS, poor quality of the broadband connection, phone OS, or defective phone.
Go into Manage Connections > Wi-Fi options > BB Key > Wi-Fi Diagnostics and see if there's an error under UMA.
Some of the error codes are here:
Wifi / UMA Error Codes - BlackBerryFAQ