Markets are a way to generate gold each turn. They can be built on any solid land tile.
A market must be connected to either your capital or a warehouse by road. They must also have a house adjacent to them. Once those requirements are met they will produce 1 gold per turn. In addition, they will produce 1 extra gold for each unique type of resource structure next to them (like farms and log cabins). Since one of the adjacent tiles must be a road, capital, or warehouse - the max a market can produce is 3 gold.