Can I run gpt2 on an RTX 5060 Ti 16 GB?

Yes

Its published weights (548 MB) fit in the 14.4 GB an RTX 5060 Ti 16 GB can use, with room for ≈ 1K tokens of context.

hf download openai-community/gpt2

Files and context on RTX 5060 Ti 16 GB

Each file of gpt2 (and of GGUF versions the site has analyzed), and how much context fits next to it, with the context cache in 16-bit or 8-bit.

gpt2 on other hardware

Popular models that run on RTX 5060 Ti 16 GB

Assumes 90% of the card's memory is usable and at least 4K tokens of context for one conversation, with the context cache in 16-bit unless noted. Fits leaves at least 20% of that memory for context; Tight leaves less.