In your case, since each line is a separate command, it doesn't make any difference - the script should work: (note that $getPID and $conkyPID should be quoted)
#!/bin/bash
getPID=$(pgrep -f conky)
conkyPID=$(ps -p "$getPID" -o etime=)
echo "$conkyPID"
I have tested, and this works fine for me.
However, since pgrep can return multiple values as output (which is true in your case), you should isolate the output so you only fetch the earliest PID. So modify like this:
#!/bin/bash
getPID=$(pgrep -fo conky)
# getPID=$(pgrep -f conky | head -n 1) # another, but not as elegant method
conkyPID=$(ps -p "$getPID" -o etime=)
echo "$conkyPID"
This will only fetch the first PID for conky, and display the elapsed time for this PID.
On the other hand, if you wish to process all PIDs that might be output by pgrep, then you can pipe the output to xargs with ps like so:
pgrep -f conky | xargs -I _ ps -p _ -o etime=
Where -I _ will both process only one arguments line(pgrep outputs each single PID on a newline by default) at a time and pass it to ps -p _ ... in-place/position of the place-holder _. ... You can also assign the value/s to the variable directly with command substitution and even shorten your script like so:
conkyPID=$(pgrep -f conky | xargs -I _ ps -p _ -o etime=)
echo "$conkyPID"