Measure the recessed area under your cabinets. Most spaces are 7/8 of an inch tall, which is the same height as most cabinet lights. Don't worry about recessed areas smaller than 7/8 inch; people standing at the counter still won't be able to see the lights while working.
Measure the length under each cabinet with the tape measure.
Determine how many lights you'll need to purchase for your cabinets. Plan to space round "hockey puck" lights 30 inches apart; plan for 1 to 3 feet apart for bar lights. Larger gaps between lights may create dark spots on the counter.