Getting SQL Server query history
I believe this is handled internally in SQL Server's query cache using memory available on the system.  I know you can empty all of the cache by running the following:

DBCC FREEPROCCACHE WITH NO_INFOMSGS;


I just don't think you can alter how many queries it's saving.  

Good luck.