Opening a bathroom window helps a little, but it is not a reliable way to get moisture out after a shower. Warm, wet air needs a real exhaust path, or it ends up in the ceiling, the walls, or the rest of the house.
A few things that actually matter:
The fan should vent outdoors, not into an attic, a soffit, or a joist bay. If you can smell the bathroom in the attic after a shower, the duct is dumping there.
Keep the duct short and as straight as you can, and use a smooth duct if you can. Long flex runs with dips collect moisture and cut airflow a lot.
A humidity switch or a timer is more reliable than hoping someone will leave the fan on long enough. The room often needs to run after the shower, not only during it.
A window can help when it is open and the air outside is drier, but it does not create a controlled path out, and in winter it can make the room colder without removing much moisture.
If the room still stays damp with the fan on, the first checks are whether it is actually ducted outside, whether the damper at the termination opens, and whether the duct is crushed or sagging.