I wish I had won a/the lottery - in the past; but I didn't.
I wish I won a/the lottery every week - but I don't.
I hope I can win a/the lottery - in the future.
We normally have only one (national) lottery in mind, so the is more likely. However, if the speaker buys tickets for more than one lottery, then a is possible.