This question comes up a lot: what is an encounter? It's never specifically defined, but it's talked about a lot. This is for RAW discussion of what actually defines encounters, which is obviously incredibly important for Factotums but also comes up for other folks. So here we go.
First, the facts.
An "encounter" is more than a combat, but it also includes any other significant event in the game such as stopping to bash down a door, navigating a rickety bridge, or dealing with a trap. If the characters have a minute or two to catch their breath and rest, assume that the last encounter has ended and all per encounter abilities refresh.
That's in the Factotum section.
the game is really composed of encounters. Each individual encounter is like its own game- with a beginning, a middle, an end, and victory conditions to determine a winner and loser.
But the DMG is mostly talking about combat encounters in that section. It later goes on to list other possible encounter types on page 51, which include the following (though it does say there could be even more kinds):
Combat
Negotiation
Environmental
Problem-Solving
Judgment Calls
Investigation
Each of those has a little blurb about it... for example, Environmental encounters include "Weather, earthquakes, landslides, moving rivers, and fires." I find it interesting that even a Judgement call (the DMG gives the example of "Do we help the prisoner here in the dungeon, even though it might be a trap?") counts as an encounter.
And ToB expands on the amount of rest needed to end an encounter on page 40:
End of the Encounter: When an encounter ends, a martial adept automatically recovers all expended maneuvers. Even a few moments out of combat is sufficient to refresh all maneuvers expended in the previous battle. In the case of a long, drawn-out series of fights, or if an adept is out of combat entirely, assume that if the character makes no attacks of any kind, initiates no new maneuvers, and is not targeted by any enemy for 1 full minute, he can recover all expended maneuvers. If a character can't avoid attacking or being attacked for 1 minute, he can't automatically recover his maneuvers and must use special actions to do so instead.
I think that's all the major actual RAW discussion of what the word "encounter" actually means, other than combat, which everybody knows.
Based on this, then, an encounter is any scene where the players are controlling the characters and have some ability to succeed or fail, and lasts until that stops. For example, if you go into the weapons store and start using diplomacy to bargain for cheaper goods, that's an encounter, which lasts until you leave the store. If you set up camp for the night and decide to build a basic alarm trap to protect yourselves, that's an encounter too and lasts until the trap is built. If the player ever has to roll a die to do anything, it's an encounter. If the player could make the wrong choice and screw something up, it's an encounter. And the encounter ends any time the characters could just stand there for a minute if they felt like it without much consequence (so most non combat encounters can end any time the players feel like it, though time sensitive ones may not, such as dealing with a series of traps in a row while rising flood waters fill the dungeon as you try to escape).
TL:DR: An encounter is a scene in game that begins when a player has their character do anything where they could succeed or fail, whether that means needing to win a dice roll or make a meaningful decision. It ends when the action in question is resolved and the character could stop for a minute.
JaronK