What are the pros and cons of giving students assignments to write Wikipedia articles?
I have on several occasions given students assignments (in math classes I was teaching) to contribute to Wikipedia, either for bonus credit or in lieu of a traditional final paper. Both I and the students were very happy with the results and with the fact that our efforts (which included fairly substantial involvement on my part, see below) resulted in the creation of a valuable resource for the community. I am therefore inclined to view this idea very positively.
That being said, in my experience this type of project would definitely not be suitable for all students and in all circumstances, so one should consider carefully (as you are indeed doing by asking the question) the various implications and factors involved.
For which types of courses does it work and for which it doesn't?
The idea is suitable for advanced classes where you cover topics that are not currently well-covered on Wikipedia. E.g., something like a calculus class is a bad idea, but a graduate class on differentiable manifolds would almost certainly involve several topics that Wikipedia needs help with.
For which types of assignments does it work and for which it doesn't?
The first rule should be "do no harm". What I mean is that some students do not have the writing skills to make a positive contribution to Wikipedia with a reasonable effort of the sort that a course assignment should involve, and we certainly don't want them making negative contributions. Thus, my philosophy is that a Wikipedia assignment should be elective - i.e. either being for extra credit or being an option the student can choose instead of a traditional paper/essay.
Another reason for this rule is that some students would feel self-conscious about writing material for public consumption, and I think it's wrong to force them to do it, even if the contribution is anonymous. Finally, submission to Wikipedia requires agreeing to its Creative Commons license which means giving up certain rights to your creative work. For legal and ethical reasons I think it's untenable to make this a grade requirement unless specifically agreed to by the student who prefers this over alternative assignments.
Will it improve students' motivation to learn?
I've definitely seen students who became very enthusiastic about the writing project and after creating a page on a new topic continued to expand it, which ended with them adding quite a bit more material than was the minimum I required. I'd also like to hope (but don't know if it's the case) that some of them might have caught the Wikipedia bug and continued contributing "for free" later.
On the other hand, some students were clearly just doing it for the grade and didn't do any more than the minimum, so I guess for them there wasn't any improvement to their motivation.
How can one define a rubric for this type of assignment?
Good question. I was using my own subjective judgment to assign grades. Those were small graduate classes and in practice almost everyone got an A or A-, so that wasn't too much of an issue, but for a larger-scale project one might have to give this question some more careful thought.
Let me add a few thoughts about things you didn't ask about. A key thing to keep in mind is that writing for Wikipedia is very different than writing other kinds of content, both technically, stylistically and philosophically (in particular the collaborative aspects). Good Wikipedia content has to be extremely neutral, unopinionated, well-referenced, and written in clear and error-free language. Frankly, in my experience very few students would be capable of producing by themselves a draft for a new Wikipedia article that would not be either outright deleted or heavily modified (possibly to the point of becoming unrecognizable) very soon afterwards by other Wikipedia users/editors -- needless to say that would be quite bad for motivation... For this reason, in the projects I assigned I ended up taking on a fairly substantial role of reviewing and helping polish up the original article drafts before they were officially submitted. This was done in a sandbox page. It was practical for me to help out in this way, first of all because I was happy to do it, and second of all because only a small number of students were involved (4-5 in each of the courses I tried this at). At the same time, there is an obvious problem of scalability here, and I would be very reluctant to attempt such a project in a large class. The bottom line is be prepared to put in quite a bit of work yourself if you want the project to be a success.
A final thought (sorry for the long answer) to consider is that it would be wise for you as the instructor to propose to the students a list of possible contributions they can make (in the form of either new articles or new sections in existing articles). Some students can also come up with their own ideas for what to write about, but I feel that most would prefer being offered a list to choose from. Good luck!
Edit: as @Thunderforge helpfully pointed out in the comments, Wikipedia has a dedicated page with guidelines to students and instructors for Wikipedia-editing course assignments.
The festering elephant corpse in the room is Wikipedia internal politics.
While you can go for quite a while reading and contributing to Wikipedia without running up against it, attempting to contribute to seemingly arbitrary topics can quickly embroil you in the seedy underbelly of Wikipedia, if you're not careful.
While there are certain articles where conflict is expected (e.g. articles on religion, politics, and controversial or popular public figures), you can run into pushback even on obscure academic topics. Often this takes the form of a some established editor self-appointing themselves as a "guardian" of certain pages or topics, and then maintaining things exactly the way they want by exploiting Wikipedia rules, their position as an established editor, or even just their ability to sink more time into it than anyone else.
For example, an academic might feel that the current level of use of a rival academic's technique doesn't rise to the required level of notability for mention in a Wikipedia article, and adding such a mention gives that technique "undue weight". Therefore any contributions mentioning the technique will be reverted/deleted. - While there are certainly ways to contest such an assessment, doing so would likely require you to become intimately familiar with the nuances of Wikipedia policy and would probably require a substantial investment of time in order to pursue the issue. (On Wikipedia it seems that the people who prevail are often the people who can spend the most time on things, rather than those who have the best arguments.) This is particularly true on obscure topics, where few people will care enough to join the conversation, and it will just be your student versus the established editor with an axe to grind.
The article linked to by z_dood in the question's comments is one such example, but you can find others as well.
My main point is that while it's probably safe to have an assignment to propose a contribution, it's probably a bad idea to require that your students contribute. That is, to have actually have your students' contributions be accepted to Wikipedia. It's unlikely that the standards you have for acceptable work in your class will match Wikipedia's standard. Having part of the rubric (or even bonus points) for acceptance by Wikipedia means that the students who - through no fault of their own - blunder into one of those Wikipedia political minefields will either not get the points, or will spend a substantial chunk of time on Wikipedia politics rather than on academic content creation.
You probably should collect their contributions independent of Wikipedia, and submission to the site should be an optional, ungraded step they can take if they want. That way you still get the motivation of possibly contributing to Wikipedia, but avoid some of the downsides of running up against Wikipedia internal politics.
For which types of courses does it work and for which it doesn't?
I think it probably works best for seminar-type courses that will be exploring (potentially) less well-trodden topics. For example, there is probably little that a student could add to the wiki article on Shakespeare, Carbon, the Rwandan Genocide, or the Pythagoream Theorem. On the other hand, there is probably quite a bit that could be added to the articles on the multitude of animal or plant species, or of lesser known authors or historical events.
For which types of assignments does it work and for which it doesn't?
I think it basically would be the assignment. You have to take into consideration that Wikipedia is not a place for original research. Thus, while in a traditional paper a student needs to argue their points, making their own judgments as to the validity/bias of a given source, that is not generally considered acceptable Wikipedia writing. As such, it could almost be seen more as a literature review or history of criticism, which is more of the first step of a paper. If you have students do papers in stages, then after compiling a bibliography and what not, it might be opportune to then have them compile their research into an straight-forward presentation for Wikipedia.
Will it improve students' motivation to learn?
That will depend on the student and how the assignment is doled out. If you tell a student "write on any topic you want", it probably will, but realistically, you're probably not going to give them that wide of a berth unless, say you're doing a translation class and you really don't care the base material much. If a student has no interest in your course's material to begin with, I doubt adding a Wikipedia-writing component will do much at all for them.
How can one define a rubric for this type of assignment?
I would begin with the background research and bibliography as a major component, the quality and readability of the prose produced as the other major one. A small, but not insignificant part would revolve around conforming to Wikipedia's standards for writing/editing.
Also, consider not just contributing to Wikipedia but to other similar projects. For example, a friend of mine has had her translation class working on the excellent Encyclopedia of Alabama, although they still haven't posted any of the translations just yet.