Swapna,
I'm not sure if i got your requirement correct, i'm not clear with following statements
" i need to create the webpart it needs to connect document library .....
how to do it through OOB featuers."
There is not such WebPart AFAIK which will provide you such functionality, but you can write some Client Side Code (JSOM) and Work with Content Editor WebPart to display a Drop-down which lists all the Document Library and on selecting the document library
you can fire up you JSOM code to get the Documents Count (using CAML query) and display the count on the Title of the Webpart.
Let me know if this make sense. or you need more help on this?
Thanks
Akhilesh Nirapure