You should be thinking about your graduate-school applications throughout your time as a research assistant. PhD applications will have deadlines as early as December 1. Start working on your application materials in the spring. Do not procrastinate.
Applicants to PhD programs are evaluated based on five things:
The GRE is straightforward. The mathematics is very simple, but you might be rusty on some subjects. You need to be properly warmed up so that you do your best on exam day. Study for a couple weeks by burning through two or three test-prep books. Take this exam early in the year, since it is possible to take the exam multiple times. You want a math score in the top decile to be a strong applicant. My understanding is that the verbal score is not heavily weighted by economics departments.
Transcript. Take as much mathematics as you can. Real analysis is not essential per se, but if you have a choice of high-level math classes, this would likely be the best class to prepare you for an economics PhD. You should have a strong track record in economics classes. Earning an A in an economics PhD class is a good way of credibly demonstrating to the admission committee that you will pass these classes.
Statement of purpose. These are hard to write. You need to provide evidence to support the hypothesis that it is in the admissions committee's interest to admit you to their program. Your first draft will be bad, so write your first draft in June. This will leave you enough time to get feedback from faculty and rewrite it a half dozen times. I suspect the SOP is closer to a necessary condition than a sufficient condition for most applications. Use the SOP to make clear details that might be ambiguous on your CV. See Chris Blattman's advice on writing your SOP.
Letters of recommendation. Faculty members are responsible for capturing all your talents that do not show up in a GRE score or a transcript. We need to assess your creativity, communications skills, tenacity, and other skills. These talents show up in your day-to-day work as a research assistant. Faculty have imperfect memory, so you should help them out. I suggest you keep a running tally of your proudest moments each workweek. Providing your supervisor a list of your contributions around the time they need to write your letter will make sure you get the credit you deserve.
Writing sample. Some institutions request a writing sample. At minimum, this is another opportunity to demonstrate clarity of thought and written communication skills. Ideally, you will demonstrate an understanding of the research process and that you're capable of independent research. The unfortunate logical endpoint of this step is basically already doing PhD-level research in order to win admission to a PhD program.
You will apply to about 30 schools. Browse the AEA's list of PhD programs. Look at schools that produce candidates in trade and spatial (use my blog posts) and look at the dissertation committees of candidates in order to figure out which schools and which faculty would suit you well.
Dates to keep in mind: