If my party and I are engaged in combat with a group of foes, and more enemies join into the fight by emerging from out of the nearby woods to attack my party, when and at what distance from the new enemies do the party members get a chance to detect them using passive perception? Or do we simply automatically detect them when they enter combat? What if they are trying to use Stealth deliberately to sneak up on us?
From what I understand, your party is in combat, you hid from your actual opponents behind an obstacle (wall, barrel, boulder or such) and you want to know how and when you can know if an additional enemy is coming to attack you from behind, right?
1) On any of your turns, you can use an action to Search, in order to detect something in your surroundings. It's then up to the DM to determine if you can hear or see (or even smell and feel) something, taking account of the circumstances (distance, ambient noise, light, breeze, etc.) In the course of doing so, he can ask you to make a perception check. There is no "standard" distance for percieving enemies.
2) You don't make passive perception checks. It's a score the DM uses when he wants to know if you beat the possible stealth check of an enemy. Once again, the DM's task is to take account of the circumstances which can help or hinder your perception (advantage, disadvantage, etc.) and decide if you're caught offguard or not.
Some games have rules for this. D&D 5E does not. Instead, it is the DM's job to make the judgment call.
Notably, there's no range at which you should say "Can I make a perception check now?" Instead, if you are in a situation where you are getting paranoid, you might say "I stop and listen for sounds of pursuit", at which point the DM will probably ask you to make check.
Otherwise, as you are just going along, the DM may look at your passive perception check (usually, as if you rolled a 10) and compare that to the creatures' stealth roll (possibly with situational adjustments). DMs often gather passive perception scores from each player at the beginning of the session so they don't have to ask later.
Or — and it is my experience that many DMs prefer to just do this in practice — they may occasionally prompt the party with "roll me a perception check, everyone". That's how you know the enemy might be close enough to hear.
You make a check when the DM asks you to
You make a perception check when DM asks you "make a perception check". If the DM wants it to be secret, he probably uses Passive perception though. Distance and other circumstances are up to the DM:
An ability check tests a character's ar monster's innate talent and training in an effort to overcome a challenge. The DM calls for an ability check when a character ar monster attempts an aclion (other than an attack) that has a chance of failure. When the outcome is uncertain, the dice determine the results.
For every ability check, the DM decides which of the six abilities is relevant to the task at hand and the difficulty of the task, represented bya Difficulty Class.
(Players' Handbook, page 174, emphasis mine)
The DM can tweak the check depends on the distance, by saying "make a perception check with (dis)advantage".
DM asks for checks when it matters
Precise distance is not very relevant here. Any check should have positive or negative consequences. A good DM keeps that in mind. For instance, they might ask you for a Perception check right before you steps into a Gelatinous cube. If you fail the check, the cube engulfs you. In other case, they can ask you for a check to evade an ambush, or to determine a surprised condition. See DMG page 236 "The Role of Dice" for more details.