Riding with ill-placed handlebar tape sucks. To make sure you don't have unsightly gaps and do it properly, you need a couple of things:
- Handlebar tape
- Finishing tape (electrical tape works well)
- Handlebar end caps (they usually come with your tape)
Make sure you start the wrap from the bottom of the handlebar and work your way up. Leave a little overlap off the edge of the bar when you start so that you can tuck it in with the caps after you finish. As you work your way up, overlap in the ballpark of 1/4 of an inch. Overlap too much and you won't have enough tape when you get to the end. Overlap too little and you'll have huge gaps showing.
The tricky part is the brake lever. Roll up the brake lever hood and figure-X it. Work the tape over the top and then under, making sure you keep the tape taut so that you don't get a gap beneath.
When you finish, cut the tape at a diagonal so that your tape finishes flush against the end and use the electrical tape to have a nice smooth look to your handiwork.