Carl Friedrich Gauss, Titan of Science: A Study of His Life and Work
written by G. Waldo Dunnington, is the definitive biography of Gauss. the quote mentioned in my question is present in this book. the writer devoted 30 years to writing this book and it is evident from the preface that he did it in an academic and scholarly manner. in a part of the preface the author says :
The present volume is derived almost entirely from contemporary
sources, both manuscript and printed works. The letters and collected
works of Gauss have been a rich mine of information. Reminiscences of
his friends and students have been useful. His descendants have been
very kind in allowing me to use letters, pictures, and other material. I
have drawn freely from what I found. The nearest approximation to a
biography of Gauss is the memorial monograph by his friend Sartorius
A856). Any biographer must use it. For some aspects of his life it is the
only source. I have profited by the learning of those who have covered
the ground before me.
in another part of the preface the book reads as follows :
It is hoped that the Appendixes will serve as a place of reference to
primary sources. The reader will observe that Chapter XXIV and
Appendix I are largely quotation, since it seems advisable to allow Gauss
and certain authorities to speak for themselves. An effort has been made
to keep footnotes to a minimum. In a work of this character it has not
been deemed advisable to cite in footnotes bibliographical references to
published letters. These are arranged chronologically in the published
correspondence and can be easily found by anyone who is interested.
The published correspondence is listed completely in the bibliography.
other similar remarks in the preface make it quite clear(at least to me) that the data in this book is genuine and reliable. the original quote of my question is on page 231 :
It was his custom to tell his friends that if others would
meditate as long and as deeply as he did on mathematical truths, they
would be able to make his discoveries. He said that often he
meditated for days on a piece of research without finding a solution, which finally became clear to him after a sleepless night. His conversation with friends sometimes was interrupted for meditation; sometimes the conversation would be continued after a gap of several days.
as a side note, there is an excellent site which contains all of of Gauss's known letters, completely sorted and listed. Currently the site provides scans, digitized printed editions and/or transcriptions of about 83% of the letters. the link is : https://gauss.adw-goe.de/ the site is currently maintained by the university of gottingen.