Someone recently asked the same question. I copied the answer I posted then and pasted it below. Hope it helps.
"The only ways that I know of require that your Android device be rooted. If you are rooted or are willing to root, it’s easy. If not, I think that you are out of luck.
The simplest way (again assuming you are rooted) is to use an app. One that has been around for quite a while is WiFi Password Recovery by Cordon Bleu. I used it, and it does the job. The only real problem is that it doesn’t work with most recent Samsung devices. It’s free on Google Play if you want to give it a try: https://play.google.com/store/apps/details?id=com.cordonbleu.
The harder way is still pretty easy. I am pretty sure it also requires a rooted device. You will also need a file manager. I use ASTRO File Manager, but there are lots of other options available on Play.
1. Go to either /data/misc/file or /data/misc/wifi. There is a chance it might be in a different directory on some devices, but this covers most of them.