For SQL Server 2008 and Above version, you can use the below code:
/* TO CREATE A NEW ROLE */
CREATE ROLE db_executor
/* TO GRANT EXECUTE TO THE ROLE */
GRANT EXECUTE TO db_executor
For the user (not a role), you can use the below code:
USE [DBName]
GO
GRANT EXECUTE TO [user]