One way to handle this is to install the cabinets afterward and make sure that they exactly hit the top edge of the tile. But this is a lot of work, and cabinet positioning can afford only so much leeway.
Or you can cut slim pieces of tile to fill in the gap. This is the most professional solution.
Or you can do what some DIY tilers do: ignore the gap altogether. Functionally, it does not matter if there is a gap. And it's an area that rarely gets any kind of scrutiny.

