You can shower immediately after replacing a faucet, as long as the replacement went as planned. However, if you applied caulk around the faucet, you will need to wait for it to dry.
Experts recommend that you leave caulk to dry for 24 hours, depending on the type. Unless it is fast-drying, it shouldn’t be exposed to water for at least the first eight hours. It might feel dry to the touch much sooner than that, but you must wait for it to fully cure.