Holding period, like cost basis, is tracked by lot (a lot is a group of shares). Each month's purchase would be a specific lot, with it's own cost basis ($1000 in this example), and it's own purchase date, which would in turn determine the holding period.
On your tax return (schedule D) you are allowed to group lots of shares if they are for the same stock and have the same holding period. So in the OP's example, you would have two lines on your schedule D: one a long-term capital gain or loss with a basis of $12,000 and purchase dates of "various" which would be the group of purchases from the first year, and one a short-term capital gain or loss with a basis of $12,000 and purchase dates of "various" which would be the group of purchases from the second year.