You get 1 additional attack, if you take the Attack action on the 1st round of combat; it does 1d8 extra damage (plus normal weapon damage) if it hits
The Gloom Stalker ranger's Dread Ambusher feature (Xanathar's Guide to Everything, p. 42) says, in part:
At the start of your first turn of each combat, your walking speed increases by 10 feet, which lasts until the end of that turn. If you take the Attack action on that turn, you can make one additional weapon attack as part of that action. If that attack hits, the target takes an extra 1d8 damage of the weapon’s damage type.
Taking it step by step:
It only applies on your turn on the first round of combat.
- It doesn't apply on subsequent turns of that combat, i.e. until you
reroll initiative (which is generally what mechanically distinguishes
one "combat" from the next).
- Your walking speed increases by 10 feet (e.g. for a human with no
other speed bonuses, it goes from 30 feet to 40 feet) only until the
end of that turn. This has no relevance to attacks (other than
potentially getting you within reach/range to make them), so I'm
ignoring it in this answer.
It only applies if you take the Attack action on that turn.
- If you use your one regular action to cast a spell, or Disengage, or
anything besides the Attack action, it has no effect.
- If you multiclass into fighter for the Action Surge feature,
though, you could potentially take two actions that round - and if
you do take the Attack action twice that round, you would get to make
the additional attack twice that round: once for each Attack action.
(This "exploit" is not possible with the haste spell, which
limits the number of attacks you can make with your new action from
the spell if you take the Attack action.)
If you're able to make that additional attack on the Attack action, and you hit, you do 1d8 extra damage with that attack.
- If the additional attack misses, you don't do the extra damage. Simple.
- Note that no general rule restricts the order in which you make the
attacks in an Attack action - and nothing in the feature specifies
when during your Attack action this "additional weapon attack" must
be made. As a result, it's up to DM discretion how it's determined
which attack gets the extra damage. Presumably, which attack is your
additional attack (from Dread Ambusher) must at least be decided
before the attack is made, so that you can't simply wait until you
hit in order to guarantee that you get the extra damage, but
naturally your DM can rule otherwise.
No special interaction with Two-Weapon Fighting
This feature has no interaction with Two-Weapon Fighting, or your bonus action. If you make an attack during your Attack action that qualifies for TWF (i.e. you make at least one - any one - of the attacks in your Attack action with a one-handed light weapon), then you can use your bonus action to attack with a one-handed light weapon in the other hand, as the TWF rule states. There's no special interaction between the two, other than that you have one more attack in your Attack action with which to qualify for TWF.
A 3rd-level ranger wielding two weapons that qualify for Two-Weapon Fighting can normally make 1 attack during their Attack action, and 1 bonus-action attack from TWF. Dread Ambusher lets them make 1 more during their Attack action on their first turn, for a total of 3 attacks; for the rest of the fight, they go back to 2 attacks per turn.
A 5th-level ranger wielding two weapons for TWF can now normally make 2 attacks per Attack action (thanks to Extra Attack), plus the 1 bonus-action attack. Dread Ambusher lets them make 4 attacks on the first turn (3 attacks during their Attack action, 1 attack as a bonus-action from TWF), and 3 attacks per turn for the rest of the fight.