"The teacher had / will have / etc. the student stay after school" is usual. "The teacher had / will have / etc. the student staying after school" is possible but less common.
"The cops caught / may catch / etc. him doing drugs in the alley" is correct. "The cops caught / may catch / etc. him do drugs in the alley" is incorrect.