It depends. Toiletries packed in your checked luggage don’t have to be packed in a plastic bag, but doing so can help ensure the containers don’t leak into your luggage.
Carry on toiletries need to be 3.4 oz. or smaller and fit into a single clear quart-sized bag that closes securely.