It's not the case that the table is "shifted" to the right in the MWE. Instead, the MWE's table is wider than \textwidth, i..e, the width of the text block. This makes its material stick out to the right of the text block.
Assuming the document's left-hand and right-hand margins are actually 1 inch (2.54 cm) wide each, you can get the longtable environment to (just!) fit inside the textblock if you also lop off the whitespace to the left of the first column and to the right of the final column, i.e., if you specify
\usepackage[margin=1in]{geometry}
in the preamble and
\begin{longtable}{@{} *{7}{c} p{5cm} @{}}
for the longtable itself.
With this setup, however, the text material in the p column will be typeset fully justified, causing occasional very large interword gaps as the column is only 5 cm wide. With such narrow columns, it's preferable to typeset the material ragged-right rather than fully justified. I thus suggest you provide the following commands in the preamble:
\usepackage{longtable}
\usepackage{array} % for "\newcolumntype" macro
\usepackage{ragged2e} % for "\RaggedRight" macro
\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash}p{#1}}
\usepackage[margin=1in]{geometry}
and then set up the longtable environment as:
\begin{longtable}{@{} *{7}{c} P{5cm} @{}}
With the P column type, you'll succeed in getting that column's material typeset ragged-right, while still allowing hyphenation. The simple \raggedright macro disables hyphenation; that's why I recommend using \RaggedRight in the definition of the P column type.
Here's the output of the code that implements these suggestions. (The black frame lines on the left and right are drawn because I set the showframe option of the geometry package.)

\documentclass[a4paper]{article}
\usepackage[showframe,margin=1in]{geometry}
\usepackage{longtable}
\usepackage{array}
\usepackage{ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash}p{#1}}
\begin{document}
\begin{longtable}{@{} *{7}{c} P{5cm} @{}}
\hline
Row & GO term & P-value & OR & Exp Count & Count & Size \\
\hline
\endhead
\hline
\endfoot
1 & GO:0009987 & 0.00 & 1.65 & 1811.17 & 2078 & 11765 & cellular process \\
2 & GO:0050794 & 0.00 & 1.57 & 648.88 & 857 & 4215 & regulation of cellular process \\
3 & GO:0080090 & 0.00 & 1.67 & 376.24 & 536 & 2444 & regulation of primary metabolic process \\
4 & GO:0009889 & 0.00 & 1.69 & 344.84 & 497 & 2240 & regulation of biosynthetic process \\
5 & GO:0051252 & 0.00 & 1.72 & 308.20 & 453 & 2002 & regulation of RNA metabolic process \\
6 & GO:0006355 & 0.00 & 1.71 & 306.35 & 449 & 1990 & regulation of transcription, DNA-dependent \\
7 & GO:2001141 & 0.00 & 1.71 & 306.35 & 449 & 1990 & regulation of RNA biosynthetic process \\
8 & GO:0031323 & 0.00 & 1.63 & 378.24 & 531 & 2457 & regulation of cellular metabolic process \\
9 & GO:0051171 & 0.00 & 1.66 & 332.52 & 476 & 2160 & regulation of nitrogen compound metabolic process \\
10 & GO:0019219 & 0.00 & 1.66 & 328.52 & 469 & 2134 & regulation of nucleobase-containing compound metabolic process \\
\end{longtable}
\end{document}