A vehicle that uses a keyed ignition slot typically has an audible warning to alert you that your key is in the ignition slot. If you open the driver's door while the key is in the ignition and the engine is off, a repeating chime sounds, explains RepairPal.
The vehicle may also have an LCD within the instrument panel that displays some sort of message about the key being left in the ignition, or a special warning lamp to indicate such a state. It may even disable its interior powered lock switches to prevent you from locking yourself out. These things all vary between manufacturers, models and even trims and equipment, so it's always best to read your vehicle's handbook for specific information regarding the vehicle's behaviors.