I completed my undergrad in Graphic design and I'm currently looking for a job. I'm aware that I need a portfolio to be considered for an interview. I would like to know ideally how many pieces of work should I submit? Also, while creating a portfolio piece is it ok to borrow content from websites or other work(posters, flyers etc).
There is really no definitive answer to this question.
It's generally best to shoot for around 10 give or take one or two. But, there is no rule.
While I don't really know what content you are referring to with "is it ok to borrow content from websites or other work" - it is generally unacceptable to "borrow" anything for a portfolio. The purpose of a portfolio is to show your work, nNot how well you "borrow" content.
That being posted, if by chance you mean something like "I designed a poster for a band named XXXX and I used dates from their North American tour I found on some other poster." that is generally not an issue. But if you designed a web site for, say, "Bob's Chokeburger" a fast food chain, you could not "borrow" content from McDonald's web site to fill in text areas and the like.
In all cases "borrowing" images, logos, and other graphic elements is a very big mistake for a portfolio.
How many is an impossible question to answer: you should have your best work there, it should represent a cross-section of the work you do or hope to do.
Posters, flyers etc are of course easy, the tricky part is websites. Images only? Links to live sites, customers?
I cannot stress this enough: keep your best work in your portfolio. It is better with few but excellent pieces, than a whole load of indiscriminate chaos of odds, ends and rubbish.
I find it odd that you are an undergrad and have not created a portfolio.
Edit: you can not use other peoples work in your portfolio. That is called theft or plagiarism
As a student of design, I was always told that I should have no more than 10 different projects.
Employers, especially in HR, and creative directors in design firms, are all very busy people: they don't want to spend a half hour looking at too many pieces.
I have seen some students bringing 30 or 40 different pieces with them and that is just way too many.
Tried to show the breadth of your experience and artistic ability. No one wants to see the 600+ logos you've created. If you are applying for a position where you know you will be designing only logos, then it might be appropriate to bring 40 or 50 small logos spread out evenly on five or 10 pages but again, don't include everything you own.