Vitamin B12 is stored in the liver for a long time.
How is it stored?
Vitamin B12 (cobalamin) is a cofactor required by the enzymes methionine synthase (MTR) and methylmalonyl-CoA mutase (MUT). These are the only known enzymes that use B12 in humans, and are abundant in the liver. Since it is a cofactor, B12 is not consumed by any reactions, and hence there is no need to store large amounts of B12 beyond that bound to MTR and MUT. (In contrast to major nutrients like glucose and fats, which are stored in large amounts.)
Early biochemical studies showed that B12 isolated from cells was bound to an unknown large protein complex, called the intracellular cobalamin binding protein (ICB). It was later found that ICB actually consisted two separate proteins, and that these were identical to MTR and MUT.
So B12 is "stored" by simply being attached to the enzymes that require it. But, as @jzx also pointed out, perhaps "storage" is not an accurate description --- cobalamin is an integral part of these enzymes; it is not present in excess, and not kept in some storage compartment from where it can be mobilized (like glycogen, for example).
B12 is stored as mitochondrial 5-deoxyadenosylcobalamin, primarily in the liver (2 to 5 mg) but also about another 1/3rd in muscle. It's estimated that 0.1% of reserves are turned over per day, and the reference values for serum B12 are 180 to 914 ng/L.
While the literature tends to use the term "storage," this coenzyme form of B12 would still be taking an active role in metabolism. As the liver and muscles have the most mitochondria per cell, they are apparently considered the de-facto reserves.
Note that my source (1) indicates that it wasn't fully understood how this stored AdoCbl is released.