Ohm's law says I = V/R. So let's say I take a 9V battery and attach 1Ω resistance across the terminals. So the current running across will be 9A. But the battery rating says only 500mAh. So are there actually 9A running across it? My simple AC switch put on 220V AC line has 5A rating, then how can a 9V battery deliver such amperage? I never understand the concept of ampere. Without attaching any circuit to a voltage source can we tell the amperage of the source?
The existing answers are correct and cover the real world situations well but seem to have very quickly dismissed the ideal theoretically perfect world which is always easier to learn.
Your battery is 9V, you put 1 ohm across it.
As ohms law says that will give you a current of 9 Amps assuming a perfect battery.
The battery capacity rating is 500mAh. That means 500mA or 0.5A for 1 hour. We are taking 9 Amps or 18 times that much so the battery will last for 60/18 = 3.3 minutes before being completely drained.
So with a theoretically perfect battery of the type you describe you would indeed get 9A flowing for 3 minutes 20 seconds after which the battery will be dead.
In the real world the battery won't be ideal.
It will have an internal resistance which will limit the current flow and is relying on a chemical process to generate that voltage, there will be rate limits and other physical considerations to that process which can normally be ignored but start to have an impact at high currents. All of which means in the real world you won't get 9 Amps but you would probably get over 5 A and still drain the battery in a couple of minutes.
Your 220V AC line is rated at 5A for safety rather than capability reasons, pulling a large current through a wire will heat up the wire which beyond the obvious fire risks can have all sorts of other nasty effects like spot welding switch contacts closed so you can't turn them off again.
The 220V AC into my house is split between lots of difference circuits, some of them are rated at 40A, some at 5A. It's all the same 220V, the difference between them is how thick the wires are and how large the switch contacts are.
Something that can handle large currents will generally be larger, heavier and more expensive. If all you need is enough power for a light bulb you may as well use parts rated for 5A and add a fuse or circuit breaker to ensure you don't accidentally go over that rather than ensuring everything on that wire is designed to cope with 40A currents.
For another example a car battery is 12V but is designed to be able to deliver several hundred amps. They can do this because the internal construction and chemistry is very different to that of a 9V battery.
To answer your final question, how do you determine the amperage of a source? There are a few key factors:
The internal resistance of the source. All voltage sources are modeled as a theoretically perfect voltage source and a small series resistance. At low currents that resistance can be ignored, at high currents it will limit the maximum output current and cause the output voltage to drop. A 9V battery has a relatively high internal resistance, a car battery has a very low one meaning that at high currents the car battery can deliver a lot more power.
Thermal/chemical limits on the source. Batteries are chemical devices, the chemistry and physical construction will often limit the maximum performance. For things like wall power supplies the limits will be the maximum power limits of the components used, these will normally be based on how much power you can put through the components before they get too hot. (For wall supplies the limit may also be how much current before the internal resistance causes the output voltage to drop too low)
The quality of the connections available. You aren't going to be able to pull 100A through a little spring terminal and narrow wire as used on an typical AA battery holder no matter how good your voltage source is, they will melt. Take a look at the connections to a car battery, 1cm diameter cables attached with large screwed on clamps, that's what you need for very high currents. Generally most portable power sources are designed such that this isn't the limiting factor however for things like domestic power distribution the quality of the cabling is often the limiting factor (with a very large safety margin built in).
You are confusing the actual current value flowing into a circuit and the maximum amperage rating of a (real, non-ideal) voltage source.
Any practical voltage generator has physical limits on its maximum current output. A battery is no exception. To know its limits you should read its technical specifications (the battery's datasheet, for example).
Therefore, a battery rated for 1A maximum, can provide any current below 1A, provided it is attached to a resistor of suitable value (according to Ohm's law).
Moreover, as @RogerRowland already pointed out in a comment, a battery, as any other real voltage source, has an internal resistance, so you should also take that into account. That means that if you connect an external load whose resistance is comparable to the internal resistance, you will experience a voltage drop at the terminals: the source won't provide its nominal voltage in this case, but a lower value.
As @WouterVanOijen already said in its answer, the Ah rating of a battery, technically called capacity of the battery, is a whole different story: it is an indication of the energy stored in the battery.
As a rule of thumb, you could use the capacity rating as a rough estimation of the maximum current the battery can provide (when fully charged): a battery with 500mAh capacity can provide 500mA for an hour continuously (or less, over a longer time span). This is called a 1C discharge rate (where 1C means "1 times the Capacity").
A fully charged battery can always provide currents that are below 1C (in the example 0.5C would mean 250 mA), but for higher current you may be at risk of overloading the battery.
Beware: as I said, this is is only a rule of thumb, though. Whether or not a battery will handle discharge rates greater than 1C must be checked for in its datahseet.
See, for example, the datasheet of a Duracell coppertop AA cell.
In this case the internal resistance will be 120mΩ when fully charged (internal resistance increases as the battery discharges).
Keep in mind that the same capacity concept is a bit blurry, since the capacity rating depends on the load conditions. See for example the following graph from that datasheet, which assumes a load that draws a constant current regardless of the voltage applied (so it is not a simple resistor, but in this case calculations are easier, as you'll see):
Considering the rightmost curve, corresponding to a 100mA discharge current, you see that the number of "service hours" varies according to which cut-off voltage you choose, i.e. the voltage at which you consider your battery dead.
If you choose your cut-off voltage to be 1.3V (red lines) your product will run for about 7h, so the cell sports a capacity of 7h×100mA=700mAh.
If, on the other hand, you choose your cut-off voltage to be 1.0V (green lines) your product will run for about 24h, so the cell sports a capacity of 24h×100mA=2400mAh.
You may also see that the leftmost curve corresponds to a 1000mA discharge rate and it is the maximum for which that cell is characterized. Although the datasheet doesn't explicitly say "max current=...", we can safely infer that that is the maximum current that the cell can deliver continuously without being overloaded. Note that I said continuously: a cell is able to provide higher current spikes for limited time (but in our example above nothing can be inferred from the datasheet about "pulse loads").
Note also that the case of a purely resistive load is covered by another graph:
The calculation of the capacity here is more difficult, since you would need to derive a graph of current vs time and perform an integral on it (i.e. the sum of the products ΔI×Δt over the time interval for which the voltage is above cut-off). This difficulty comes from the fact that for a pure resistive load the current varies with time as the voltage slowly decreases due to discharging.
Finally, see that the discharge curves (and so the capacity) vary also with temperature. Here that datasheet provide only what happens for a 100mA discharge rate:
You can see that at 0°C the discharge is more rapid (less capacity): 100mA×16h=1600mAh@0°C vs 100mA×24h=2400mAh@21°C. Therefore this kind of cell is better suited for operation at room temperature.
your calculation 9V / 1 Ohm = 9 Ampere is correct (only) for an ideal voltage source. A battery is a real-world item. Real-world items are generally not ideal.
A reasonable approximation of a 9V battery is a 9V voltage source with a series resistor (a few ohms to a few tenths of ohms, depending on the type of battery, check for instance http://www.learningaboutelectronics.com/Articles/Battery-internal-resistance).
The 500mah you refer to is the amount of energy the battery can deliver during its life time: 500mA for one hour, or 50mA for 10 hours, or 5mA for 100 hours, etc. This too is an approximation: at the higher currents the lifetime will be shortened, and at very low currents the self-discharge of the battery will dominate.