It depends how much you drank and your size. It should take about two to four hours to sober up but it takes longer for it to be completely out of your system.
in very general terms it takes one hour per drink, eg a pint of beer, 6 oz. wine, 1 shot etc. However you will still be over the driving limit. The exact time depends on your health, size, how much...