For a horizontal pocket: When you get to where you want the pocket, knit across the pocket location with a piece of scrap yarn same weight but different colour so you can see it later. Slip the scrap yarn sts back to the left needle. Knit across in sweater yarn. (this is the same concept as an "peasant heel".) Continue knitting the sweater for several rows or until you've finished the body. Carefully take out the scrap yarn putting the live sts on 2 needles (all the sts from the top of the scrap yarn on one needle, the sts from the botton on another. From the bottom sts knit your pocket edging and tack it down above the opening. From the top sts knit the pocket lining and tack that down on the inside. Eliabeth Zimmerman does an "after thought" pocket like this but without the scrap yarn,
For a verticle pocket. Determine the location of the top of the pocket. At this point and for the length of the pocket, use a separate ball of yarn for each side of the pocket. Work (you will have to go back & forth if you had been working in the round) until you have the length of pocket you want. Reconnect the two sides. To finish pocket, pick up sts along one edge for the pocket edging and along the other edge for the pocket lining. Tack down the first on the outside and the second on the inside.