I remember reading a short story a while back. If I remember correctly, the original story was written in Spanish and it must have been published in the 1940's.
The plot was that there was a wizard (if I'm not mistaken) that used to teach people how to sleep and create people in their dreams. He would tell them that the more they slept, the stronger their created people would get.
The people they created couldn't realize that they were just dreams and not real people; the only way to realize it would be to experience something that would be really painful for normal people (like falling from a height or being burnt alive). These people wouldn't be able to feel any pain, thus realizing they are not real and stop existing.
The protagonist went on sleeping for as many as 18 hours a day to train his creation, until one day his creation realized that he was not real (he was burnt I think).
The wizard was really disappointed and went on long walks and accidentally (?) fell from a cliff. But he didn't feel anything. That was when he realized that he, too, was a dream of someone else.
Does anyone know this story?