There are number of apps to do this in case of rooted phones. But this procedure does not require your phone to be rooted.
First connect the phone via usb and run
$ adb usb
$ adb tcpip 5555
Then run the following command to figure out the IP address of the phone.
$ adb shell ip -f inet addr show wlan0
Say the IP address of your phone is 192.168.1.4, run the following command to connect to the phone over Wifi:
$ adb connect 192.168.1.4