Every town has different regulations about adding an accessory structure. Contact your town or township to learn what the regulations are in your area. You will be responsible for obtaining any required permits and the fees associated with them.
If you are purchasing a portable structure (one with a wooden floor), make sure the town understands the building is not a permanent structure. In most of cases, property taxes will not be affected if the building is not permanent and the pad is permeable.