Metal or glass food vessels that are acquired from a non-Jew, require Tevilas Keilim – immersion in a Mikva. This applies even the Keilim are new and have never been used. The Gemara derives this from Parshas Matos, where Elazar instructs the soldiers how to Kasher the Keilim that they plundered in their war with Midian.
There is a dispute in the Rishonim – both the Halachic authorities and Torah commentaries, whether Tevilas Keilim is a Biblical obligation or whether it is a Rabbinic obligation and the Pasuk is merely an Asmachta (brought as a support). This refers to metal Keilim. Tevilas Keilim for glassware is Rabbinic according to all opinion. Whether Tevilas Keilim is considered Deoraisa or Derabbanan has implications on whether one may perform Tevilas Keilim on Shabbos or not.
Background
The Mishna presents a dispute between Beis Shammai and Beis Hillel whether an impure person may immerse in a Mikva on Shabbos. However, they both concur that one may not immerse Keilim that were impure in a Mikva on Shabbos. The same applies on Yomtov. The Gemara provides 4 reasons for this prohibition; Rabbah teaches that it is due to a concern that one may carry the vessels in a public domain and violate Shabbos. The Rabbis applied this decree even on Yomtov and even in places where there is an Eruv as a safeguard.
Rav Yosef taught that it is because of a concern that one may squeeze the water out of clothing that would be immersed. The Rabbis applied their decree to all Keilim, even where there is no concern of squeezing.
Rav Bivi taught that the sages were concerned that one would leave their Toiveling to do on Shabbos or Yomtov when they would have more free time. The concern is that they may unintentionally use the Keilim for Terumah in the interim, before they were immersed.
Rava explains that the prohibition is because immersing a vessel to purify it makes the vessel useable and as such resembles the act “fixing a vessel”, which is a Biblical prohibition.
This discussion in the Gemara refers to immersing Keilim to purify them from Tumah. The Rishonim discuss whether the same concern applies to Tevilas Keilim for vessels that were acquired from a non-Jew. The answer depends on what is the reason for not immersing Keilim that were impure.
The concern of squeezing only applies to clothing and would not apply to food vessels, which only require immersion if they are made of metal or glass. Likewise, the concern of delaying immersing would not apply, because even if one inadvertently used the Keilim before immersing them, the food would remain Kosher.
However, the concern of carrying would still be applicable. The concern of resembling “fixing a vessel” would also apply to Tevilas Keilim which renders them useable.
The Rif only brings the reasons of Rav Bivi and Rav Yosef. Therefore, he would permit Tevilas Keilim on Shabbos. The Rambam also rules that Tevilas Keilim may be performed on Shabbos.
However, many Rishonim rule that one may not immerse Keilim on Shabbos. The Rosh writes that the primary reason is that of Rava. Based on this, he rules that one may not immerse new Keilim that were acquired from a non-Jew, on Shabbos or Yomtov. This is also the ruling of the Rashba.
The Shulchan Aruch brings both opinions, concluding that one who fears Heaven should be stringent. Rather than immersing the vessel, they should give it to a non-Jew as a gift and borrow it back to use on Shabbos.
Even though one may not give gifts or borrow on Shabbos, where the gift is for a Shabbos need such as in this case – to be able to use the vessel on Shabbos, borrowing or gifting is allowed.
After Shabbos one may technically leave the Keilim in the ownership of the non-Jew and continue to use them without Tevilah. Giving Keilim to a non-Jew to avoid having to immerse Keilim may even be done on a weekday.
However, the Ta”z writes that it is inappropriate to do this in an ongoing manner, and after Shabbos one should immerse the vessel in the Mikva. If it is still “borrowed” from the non-Jew one would not make a Bracha. If the non-Jew gives it back as a gift, it may be immersed with a Bracha. The Alter Rebbe and Mishna Berura rule like the Ta”z.