You can consolidate your federal student loans into a Direct Consolidation Loan once they are in the grace period, or have entered repayment. If you choose to consolidate during your grace period, your loan will enter repayment upon consolidation (meaning you may lose some of your grace period time).
If you want to refinance with a private lender, you can refinance your federal and private student loans as soon as the loan is disbursed. However, if you do this with your federal student loans, you will lose benefits such as the six-month grace period students are given after graduation before their loans enter repayment.