UPDATE: A new (as of January 2015) FAQ entry from Paizo indicates Reach weapons do reach the second diagonal. This means the diagram below is now wrong. See the FAQ entry here.
Most small and medium creatures (which includes pretty much all PCs) threaten the squares they occupy and the squares immediately around them. This determines whether they can make a melee attack on a target, flank and provoke attacks of opportunity.
Characters can buy some weapons, such as paricularly long polearms, that are longer than usual. However, these reach weapons do not threaten the squares immediately around their wielder, but the squares 10 feet away (see Core Rulebook p145, or the PRD here).
Reach weapons available in the Core Rulebook are the longspear, the glaive, the guisarme , the ranseur and the whip.
This can cause some confusion because of the way Pathfinder calculates diagonal distance in 5-foot squares (the first diagonal square is work 5 feet, the second 10 feet).
Some GMs disregard this, and say reach weapons threaten the far corners, even though they’re technically 15 feet away (this was a rule in the 3.5 edition of the game Pathfinder is based on).
I favour the strict interpretaton of the Pathfinder rules, that reach weapons do not threaten the “far” corners (see this post by Paizo Creative Director James Jacobs).
This has an effect on the reach-weapon user’s attacks of opportunity and potential targets. It’s possible to attack someone with a reach weapon without being threatened by them, if you’re clever (and they stay still): move into a corner square, and stop. You’re not threatened. Next turn, take a 5-foot step to stand next to them, and attack. They still aren’t threatening you (they’ll need to step back to do so).
But you can’t simply use a regular move action to dash in and attack a reach-weapon user along his diagonals without provoking an attack of opportunity, because you’ll still cross the 10-foot threashold on your way in (see this post from Pathfinder co-designer Sean K Reynolds).
Here’s a diagram showing how it all works. The cloaked charatcer in the middle has a reach weapon and is surrounded by enemies: