Invisibility

Critical text on invisibility is found at:

DMG 59-60: “Invisibility”

DMG 70: “Invisible Opponents”

Losing invisibility

When under the effect of invisibility, if an action is taken that can possibly be interpreted by the DM as an attack, it counts as an attack for ending the spell. Examples include breaking open a barrel or throwing a rock. Note that the rules specifically say that opening doors does not break invisibility.

IMPORTANT: If an item leaves an invisible creature's person, it becomes visible. It does not become invisible again when it is picked back up. If a visible item is being held, attacks against the creature can be made at -4. If an entire clothing set or suit of armor is visible, attacks are as though the creature was not invisible at all.

Due to the above, invisibility can typically not be maintained during downtime, since the character will need to pick up and remove several items during the course of everyday life. Furthermore, going around invisible in a settlement is not possible since people will be uncomfortable, distrusting, or even hostile to an invisible creature. Everyday activities will be difficult as well. For these reasons, characters will not be invisible at the start of the next adventure.

From magic devices

Invisibility caused by a magic device cannot be triggered again until one full round after invisibility is broken. Put another way, if someone attacks while under the effect of a ring of invisibility, their opponents will end up getting a combat round where the wearer is visible before the wearer can use the ring again.1) DMG 59-60. This does not apply to psionic invisibility.

When being seen going invisible

Any time someone goes invisible in view of enemies, enemies can still target them, but with the regular -4 to hit.1) This does not apply to psionic invisibility.

Coming out of invisibility to attack a charging target

If invisibility is broken in order to fire missiles at or otherwise attack a charging target, the creature which lost invisibility is a potential target of the charging creature.2) This is, in part, because a target does not need to be declared for a charge (E) or strike (G), only for spellcasting. See Combat Procedure for more detail.

Being targeted the round a creature becomes visible

A creature which has come out of invisibility can be attacked on that same round, assuming that an enemy's attack comes after the creature came out of invisibility.3) There is no rule that says otherwise. In practice, this means it could be potentially useful to lose initiative, though on the other hand, being able to attack first can have its own advantages, even if invisibility is lost.