Conservatively, you would want to make the withdrawal in the year the scholarship is received. However, there is no clear guidance on this issue. Typically you want to match withdrawals to the year in which an expense is incurred, and so I would personally follow the same logic when making a withdrawal for receipt of a scholarship.
This is an older article, but the information is still applicable: http://www.savingforcollege.com/questions-answers/article.php?article_id=75
I know this isn't a clear answer, but I hope it is helpful.
Good luck,
Brian Boswell
VP, Research & Development
This information does not constitute tax advice and is provided for informational purposes only. Please consult your tax advisor, financial advisor, local taxing authority, and/or plan provider or sponsor for more information.