It depends on what you said: how much can you contribute to the project in the time you are there.
Hypothetically, if you made a breakthrough and the project changed direction because of what you did (unlikely for a couple of months of work, I know), then you'd totally deserve authorship, and possibly 1st authorship. As I said, that case would be highly unlikely, specially in basic science research, but I suppose it is not impossible.
However, if you happen to contribute something that is key, even if the whole paper is not based on it, but it helps make the main argument, I'd say you do deserve authorship. Even if they use some of your data in the paper, for whatever purpose, you should get some authorship.
This is very relative, and in the world of research, highly variable among PI's. By luck, your PI might be incredibly nice and help you by putting you in the paper even if you did next to nothing tangible that was used, but showed interest and helped in less tangible ways (say setting up gels, finding references, etc...). This could happen. The opposite situation in which you did some experiments that suddenly became important for the project but got taken over and repeated by some other lab member (i.e., a postdoc), and it was that data that was finally included in the paper, is not unkown. In this case you could end up with nothing...
So, to summarize, it does depend on how nice your PI is to a small extent. Mostly, though, it will depend on how important is the data you generate, and whether or not it is used in the paper.