When a person says he would be happy to win the lottery he is usually wrong? Why are people bad at judging their happiness in the future? A person who knows that he will get a fancy house in the future thinks he will be happy. But when he ends up living in it he is not as happy as the thought he would be.
Like many people, I do this a lot, the whole thought process "If I won the lotto...". Following on from the term that AsheeshR linked in his comment, there has been several studies on the phenomenon of the Hedonic Treadmill.
One particular study is "Getting off the hedonic treadmill, one step at a time: The impact of regular religious practice and exercise on well-being" (Mochon et al. 2008), where they assert that a sudden large event, such as winning the lotto gives an initial burst of happiness, but we quickly adapt, from the article:
Many studies have shown that few events in life have a lasting impact on subjective well-being because of people’s tendency to adapt quickly; worse, those events that do have a lasting impact tend to be negative.
Whereas, regular small-scale events, using the examples provided in the article: exercise, religious attendance, and I'll add seeing a good movie, meeting an old friend etc may do so
by providing small but frequent boosts: if people engage in such behaviors with sufficient frequency, they may cumulatively experience enough boosts to attain higher well-being.
The authors of the article suggest that major events, such as winning the lotto do not promote a lasting sense of well being as do frequent smaller scale events.
An earlier study that found similar results was "Lottery winners and accident victims: is happiness relative?" (Brickman et al. 1978).
Some people actually become less happy after they win the lottery. Here's one possible explanation of why. There are lots of people each of which they can help but they don't have enough money to help all of them. Since they have so much money, they can help some of them but because they're already helping some of them, they don't have enough money to help the others. They end up getting criticized by some of them people they aren't helping because they can help them but aren't.
Some people might not encounter that problem after they win the lottery and instead feel happy at first because they can help so many people and not worry that they aren't helping even more people that they could have helped, but they eventually stop being more happy because their brain adapts. If it's an autistic megasavant, they might continue being happy that they won the lottery because they'll keep remembering their initial impression of their new life style of finding it wierd and different and continue finding it wierd and different.