Mentor triggers when the creature with mentor attacks — specifically, the ability triggers at the beginning of the declare attackers step when the creature is declared as an attacker (CR 702.134a). This means the trigger goes on the stack before blockers are even declared, so blocking does not prevent the trigger from occurring.
However, being blocked does matter indirectly. Mentor requires you to target an attacking creature you control with lesser power. If the targeted creature's power is no longer less than the mentor creature's power when the ability resolves (for example, the mentor creature got -3/-3 from a spell), the ability does nothing. But a blocker being assigned to the mentor creature itself is irrelevant to the trigger or its resolution.
The +1/+1 counter is placed on the target creature when the ability resolves — during the declare blockers step or combat damage step, depending on the stack — and is permanent. The mentor creature does not need to deal combat damage for the counter to be placed (unlike, say, older 'deal combat damage to a player' triggered abilities).
Concrete example: You attack with Haazda Marshal (1/1, mentor) and Boros Challenger (2/3, mentor). Boros Challenger's mentor trigger goes on the stack targeting Haazda Marshal. Your opponent then blocks Boros Challenger with a 5/5. The mentor ability still resolves, Haazda Marshal gets a +1/+1 counter, and Boros Challenger is simply destroyed in combat. Blocking did not stop the trigger or the counter.
Relevant rules: CR 702.134a states the mentor ability triggers whenever the creature attacks, and CR 509.2 covers the declare blockers step occurring after triggers from the declare attackers step have resolved.
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.