When is it proper to add someone to your research paper? I am an undergraduate working on a research project that is going to be published. My research adviser wasn't completely able to help with a certain portion of the research, so I contacted another professor (in a completely different department) at my university who was more than willing to help.

It seems that this other professor is going to be providing a huge amount of help. Should I offer inclusion in the paper? Should I bring this up with my main adviser and/or should I be upfront with the secondary adviser?
You should discuss the issue with both faculty members.  I would bring it up with your primary advisor first...if only for linguistic reasons (i.e., the meaning of the word "primary").

When you say that the project is "going to be published", do you mean that it has already been written and accepted for publication?  (If not, how do you know?)  In general it is a good idea to discuss issues of coauthorship as early as possible.  If you are already writing the paper it is on the later side, and if you have already submitted it then it is very late (but maybe not too late).

That's all I can think to say on general principles.  It depends a lot on the field and what kind of work has been done.  

tl;dr: As an undergraduate, you can't know the subtle expectations regarding coauthorship in your discipline.  So err on the side of graciousness and inclusivity.  The worst that can happen is that you get a "Aw, how cute: he thinks I want to publish with him" type of reaction.  If so, you will definitely not have offended the faculty member and you'll probably engender a lesson about how publication culture works in your field: no problem there.