Packet switching when the communication is not continuous, when you wish to support more communication circuits, when the transmission capacity across the network is unmatched, when the calls are of long duration. It is preferred when the communication is not continuous since it could improve utilization of the link, since the link is shared by many packets from different calls. It is preferred when the calls are of long duration since it may prevent blocking. Compare datagram and virtual-circuit packet switching wrt routing. Routing decision is made for each packet for datagram, whereas it is made for a connection for v-c.
All packets take the same route in v-c and they arrive in sequence.
This is not so for datagram. Depends on total number of packets, duration of the communication, traffic load, and also desired flexibility in case of heavy load or node or link failure. If the number of packets are small or the time of the connection needed is small, use datagram and avoid the overhead of establishing the virtual-circuit. If you use datagram with multiple packets then the routing decision needs to be made for each packet and this may reduce throughput. With heavy traffic load and resulting congestion, datagram is more flexible and the overall throughput may be higher.