The tax was introduced in order to avoid an unpopular income tax in England and Wales in 1696 under King William III. During different time periods, the number of windows per tax amount varied. Originally there was a 2 shilling tax on a house and additional tax if there were seven windows and more for a certain number of windows above that. Houses can still be seen that have bricked up windows, likely originally to avoid taxation. The wealthy put many windows in, sometimes likely to display their wealthy status.
The poor had small houses, or none. The tax was hard, though, on the middle class. Besides the obvious struggle to afford the tax, people had to be able to see to work, and if there were less windows, they had to buy more candles! The people felt that they were being taxed for light and air and the tax was very unpopular.
There was also a tax on bricks and wallpaper at times, and there is still a tax on doors and windows in France.