There are 193 member countries in the United Nations (UN). Besides these, there are lots of other sovereign countries that are currently not a member of the World Bank. So,
How can a country (UN or non-UN member) become a member of the World Bank?
In their official website, they stipulate as follows:
To become a member of the Bank, under the IBRD Articles of Agreement, a country must first join the International Monetary Fund (IMF). Membership in IDA, IFC and MIGA are conditional on membership in IBRD.
So the first step to become a member of the World Bank is to join in the International Monetary Fund. When you're member of the IMF, to apply a membership you need to follow the Internacional Bank for Reconstruction and Development Articles of Agreement, which says in the Article II, Section 1:
(a) The original members of the Bank shall be those members of the International Monetary Fund which accept membership in the Bank before the date specified in Article XI, Section 2 (e).
(b) Membership shall be open to other members of the Fund, at such times and in accordance with such terms as may be prescribed by the Bank.
In the Article XI, Section 2 (f) specify that membership are open for anyone, even if you're member of the UN or not:
(f) After December 31, 1945, this Agreement shall be open for signature on behalf of the government of any country whose membership has been approved in accordance with Article II, Section 1 (b).
Note that you are member after you deposited the money required by the Bank, stipulated in the Article XI, Section 2(b):
(b) Each government shall become a member of the Bank as from the date of the deposit on its behalf of the instrument referred to in (a) above, except that no government shall become a member before this Agreement enters into force under Section 1 of this Article.