I don't know if there is a rule. I use different prepositions, depending on context, for instance
Sie arbeitet bei der (Deutschen) Bank.
or
Er arbeitet in der Post (neben dem Bahnhof).
would sound totally ok to me too.
If you would have to come up with a rule, I would say:
Say "in" if you mean the place or building (in einer Bankfiliale, in der Poststelle, im Einkaufszentrum etc.)
Say "bei" in combination with an indefinite article, if you refer to a company or instituion (bei einer Bank, bei einer Aktiengesellschaft etc.) or in combination with an definite or without an article, if you refer to a particular company or instituion (bei der Post, bei der Bahn, bei der Technik GmbH, bei Müller & Söhne etc.)
Say "als" if you refer to the profession (als Postbote, als Bankangestellter, als Zugführer etc.)
Say "an" if you mean "near"/"close to" (am Bahnhof, an der Ecke) OR "working on" (an einer Klassenarbeit, an einem Projektauftrag etc.) OR if you refer to the location, but "in" wouldn't make sense (am Bahnhofsschalter, an der Kasse, an der Rezeption etc.)
Still, these are not absolute, static rules. Basically, you can use a lot of other prepositions too, for instance "auf":
Er arbeitet auf der MS Princess (Schiff).
Sie arbeitet auf dem Markplatz.
...or even:
Er arbeitet unter dem Hauptbahnhof im Technikraum.
etc. etc. ...
bei
orauf
der Bank?? it sure means in the building, but not neccesarily "at" the credit institute... Maybe auf is just a regionalism in my area?? also "Die Post" is a more idiomatic expression. there you cannot use indefinite Article. – Vogel612 Sep 12 '13 at 06:50