First/Second test? Are you sure you are thinking about SCJD? SCEA has two tests and an assignment, but SCJD only has 1 test.
With SCJD you submit your assignment, then take the test. The test will ask you questions about what you did in your assignment.
According to Sun you should [must?] not take the test before submitting the assignment. This makes sense since:
They would not want you to change the assignment to match your answers
The test is normally taken right at the end of your SCJD, at a time when you probably don't want to do any more work on the assignment. So making changes to your assignment to match your answers is probably the last thing you want to do.
Since the test is used to verify that you wrote the code that you submitted, it makes no sense for an assessor to look at the code until you have taken the test.
You will not get separate results for the test - you just get back a result for the assignment. And, as mentioned in the previous paragraph, you wont get that until some time after you have taken the test.
So if you ever want to see any result you must take the test.
Given that the test is based on what you wrote in your assignment (e.g. "Explain whether you used Java or .Net to code your assignment, and why" - no, this is not a real question ):
It makes sense for you to take the test as soon as possible after submitting the assignment, while the details are fresh in your mind.
Delaying the test makes no sense as there is nothing for you to study, but there is the chance that you will forget things
Having said all that, Tim is correct: there is no time limit between when you submit the assignment and when you sit the test (I suppose that in theory they could be years apart - this makes no sense to me, but it is plausible).